Replace Text in a Database

If you need to perform an update on some text value in your database, you can easily get the job done using the REPLACE() function.

UPDATE 
    [Table]
SET
    [Column] = REPLACE([Column], 'Old Text', 'New Text')
WHERE
    [TableID] = 1

I strongly suggest using the WHERE clause. You don’t want to accidentally update a row you didn’t mean to.

I hope that helps!

Subscribe

0 comments