Friday, 27 March 2015

How to replace a string in a SQL Server Table Column

In a table which a column references string  and I need to change the same string to the new one, in every record.

Sytax

update my_table
set path = replace(Column_Name, 'oldstring', 'newstring')

you can also read:










Example

update tblStudent
set Email = replace(Email, '@yahoo.com', '@gmail.com')

No comments:

Post a Comment