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');
Comments (2)
Thanks ,it ‘s very good , but I want to ask how can I put a picture uploaded from my website in a certain column in my SQL in direct way(by the way I make the column binary datatype) thanks for u A.B
Thanks it worked a treat. I like your syntax names, clear!