I am trying to write an SQL script where I can replace data in multiple columns, see below:
UPDATE SohailsTest.dbo.OBJECT SET VARIABLE = REPLACE(VARIABLE, 'C:\', 'E:\') SET STATIC = REPLACE(STATIC, 'C:\', 'E:\');
I have tried the above, but it says:
Msg 102, Level 15, State 1, Line 3 Incorrect syntax near '='.
What am I doing wrong?
You need to use only one
UPDATE SohailsTest.dbo.OBJECT SET [VARIABLE] = REPLACE([VARIABLE], 'C:\', 'E:\'), [STATIC] = REPLACE([STATIC], 'C:\', 'E:\');