Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi!I am trying to replace a couple of quotes with single quotes in my database. The values I am trying to replace are all in the form of "xyz", so the code I am trying to run looks as following:
UPDATE catalog SET description = replace(description,""xyz"","'xyz'");
However this will throw an error and I would therefore like to know how to batch replace every "xyz" with 'xyz'.Thanks in advance!
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts
Posted - 2013-01-09 : 11:19:39
UPDATE catalog SET description = replace(description,'"xyz"','''xyz''');==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy.
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/