Replace text in a column in SQL Server

We were working on a database which has a column for storing an image path. The path has been changed and we need now to update that column with the new path.

Please find below a simple SQL update statement that replaces text, you may use it with any column that has type of char, varchar or nvarchar:

UPDATE [TableName] SET [ColumnName] = Replace([ColumnName],'OldText','NewText');

Share this post

Leave a comment

Previous Post

Next Post