Replace in Sql server

  • Hello All,

    I have the following query ..

    I have a Table called Table1 ,having column name

    Body. inside the Column(Body) I have the following

    "Dear Ms/Ms {{T}} ({{K}})

    "

    1> I want to Replace {{T}} ,{{K}} by

    Hello (900090} at runtime

    ie using Select Body

    from Table1

    how to write a replace for that ???:-)

  • You can use REPLACE twice...

    SELECT REPLACE(REPLACE(Body, '{{T}}', Col1), '{{K}}', Col2) FROM Table1

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply