Reputation: 127
Looks like a simple question but I couldn't get what I need in MsSql while I can do it easily in MySQL and Oracle.
In MySQL: UPDATE table_spec_data SET coverage=33 WHERE (specification_id, data_id) IN ( (247,1), (248,2), (249,3) );
In Oracle: UPDATE table_spec_data SET coverage=33 WHERE (specification_id, data_id) IN ( SELECT 247,1 FROM DUAL UNION SELECT 248,2 FROM DUAL UNION SELECT 249,3 FROM DUAL );
Does anyone knows how to do it with MSSqlServer ?
Upvotes: 0
Views: 49
Reputation: 43023
I think you need to do it the hard way:
UPDATE table_spec_data SET coverage=33 WHERE
(specification_id = 247 AND data_id = 1)
OR (specification_id = 248 AND data_id = 2)
OR (specification_id = 249 AND data_id = 3)
Upvotes: 1