I have a table which has a structure as:
ID  DBInstance  DBName  Tag
1  | INS1     | master | NULL
2  | INS1     | tempdb | NULL
4  | INS2     | master | NULL
5  | INS2     | tempdb | NULL
I want to update the tag in this table as based on the condition as: 1) Update tag as "a" only for DBInstance as "INS1" and DBName as "master" 2) Update tag as "b" only for DBInstance as "INS2" and DBName as "tempdb".
And I want to update both of these two only in a single statement, not in two different update queries. How can I do so? A query somewhat like this:
UPDATE tbl_test 
SET tag = 'a' where DBInstance in ('INS1') and DBName IN ('master'), 
tag = 'b' where DBInstance in ('INS2') and DBName IN ('tempdb') 
But obviously, this query is wrong, so how can I do so?
 
     
    