How to replace a SQL Server string string with SQL Server data string

I want to write a query that will have the same effect as the code below

string asd="today is a great day"; asd=asd.replace("day","oldday"); 

I hope you understand what I mean :)

I want to modify whole tables. therefore, all raw data will be replaced.

SQL Server 2008 R2

Thank you

+4
source share
1 answer
 UPDATE dbo.TableName SET ColumnName1 = REPLACE(ColumnName1,'oldday','newday'), ColumnName2 = REPLACE(ColumnName2,'oldday','newday'), .... 

REPLACE (Transact-SQL)

+11
source

Source: https://habr.com/ru/post/1338514/


All Articles