SQL Statement with multiple SETs and WHEREs
Solution 1:
NO!
You'll need to handle those individually
Update [table]
Set ID = 111111259
WHERE ID = 2555
Update [table]
Set ID = 111111261
WHERE ID = 2724
--...
Solution 2:
Best option is multiple updates.
Alternatively you can do the following but is NOT recommended:
UPDATE table
SET ID = CASE WHEN ID = 2555 THEN 111111259
WHEN ID = 2724 THEN 111111261
WHEN ID = 2021 THEN 111111263
WHEN ID = 2017 THEN 111111264
END
WHERE ID IN (2555,2724,2021,2017)
Solution 3:
No. That is not a valid query. You can only have one SET statement, with multiple fields, however, one WHERE clause as well
update table1 set field1=value1, field2=value2, field3=value3 where filed4=value5