Hey Friends I want to replace 1 to 'asd' and 10 to 'asdddd' in a string like 1and2and10 but it replace it to 'asd'and2and'asd'0 in sql server please help.
Thank you
Hey Friends I want to replace 1 to 'asd' and 10 to 'asdddd' in a string like 1and2and10 but it replace it to 'asd'and2and'asd'0 in sql server please help.
Thank you
Try:
SELECT REPLACE(REPLACE('1and2and10' , '10', 'asdddd'), '1', 'asd')
or with table:
SELECT REPLACE(REPLACE(myColumn , '10', 'asdddd'), '1', 'asd') FROM myTable