Michael
Michael

Reputation: 87

SQL Server Update a column character on the fly

I have a DB table that has a column called Pools, the programmer made an error and has the data as so:

pool1,pool2;pool3;pool4

I need to update every row in the table, and just replace the same data back in except replace(column, ',', ';'). Replace the commas in a given column in a row with semi-colons.

Any thoughts?

Upvotes: 0

Views: 2291

Answers (1)

Mikael Eriksson
Mikael Eriksson

Reputation: 138960

update YourTable set
  Pools = replace(Pools, ',', ';')

Upvotes: 2

Related Questions