isnt it just a matter of this?declare @str varchar(5000) = 'This is a test sentence to test the replacement of word based on table'declare @t table(strval varchar(100),replaceval varchar(100))insert @tvalues('test','sample'),('word','part')select @str = REPLACE(' ' + @str + ' ',' ' + strval + ' ',' ' + replaceval + ' ')from @tWHERE @str LIKE '% ' + strval + ' %'select @stroutput------------------------This is a sample sentence to sample the replacement of part based on table
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs