So say I have a table named Description with a column that store strings listing student descriptions...
St_Desc
Student: Adam / Age: 19 / Major: English
Student: Ben / Age: 22 / Major: Biology
And I have another table named Info that stores student info
St_Id | St_Name
1000 | Adam
1001 | Ben
So for the table with column St_Desc I want to replace all of the names with their respective Id number. So the result I'm looking for is this..
St_Desc
Student: 1000 / Age: 19 / Major: English
Student: 1001 / Age: 22 / Major: Biology
What I have tried so far is storing St_Name and St_Id in separate variables and then doUPDATE [dbo].[Description] SET [St_Desc] = REPLACE([St_Desc], @name, @id). But that didn't change anything. I don't know how I can get the REPLACE function to go through all the names and replace them with its ids. I'm not very familiar with sql scripting so feel free to go into detail. Thank you.
stufffunction. (msdn.microsoft.com/en-us/library/ms188043.aspx)