So i have a pretty large table, 300+ columns. The first column is an ID column e.g. 9001, 9002 etc
The rest of the columns are int columns and they all have a value of '100', e.g. below:
9001, 100, 100, 100, 100, 100
9002, 100, 100, 100, 100, 100
9003, 100, 100, 100, 100, 100
What i want to do is where ID = 9001, i want to replace all values that are '100' with '200'
My question is: is it possible to replace all the values in the table that meets the where clause criteria.
At the moment what i am doing is essentially:
set
[column1] = replace ([column1], '100', '200'),
[column2] = replace ([column1], '100', '200'),
[column3] = replace ([column1], '100', '200')
where id = 9001
set
[column1] = replace ([column1], '100', '200'),
[column1] = replace ([column1], '100', '200'),
[column1] = replace ([column1], '100', '200'),
where id = 9002
As you can see this will take me forever to write for 1000s of IDs and 300+ columns, is there a quicker way of doing this?