Luka Luka - 1 year ago 89
SQL Question

Replace character in whole table in SQL Server

I would like ask you how I can replace 1 character in the whole table?

I want replace character which is

and change it to

I found :

I read lot of staff but i found code for replacing character only one column in whole table.. I try add names of columns to line but that does not work..

I have :

Column1 Column2 Column3
©pple ©og ©ook

I need:

Column1 Column2 Column3
Špple Šog Šook

Thanks for any opinion

Answer Source

You can update multiple fields at once in your UPDATE statement.

UPDATE dbo.authors
SET    city = replace(city, 'Salt', 'Olympic')
     , city2 = replace(city2, 'Salt', 'Olympic')
     , city3 = replace(city3, 'Salt', 'Olympic')
     , ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download