yashish444
02-02-2009, 03:35 AM
Hi
I need to update more than 1 row with different condition (where clause) per row in the same table (SQL Server).
something like this:
UPDATE mytable SET name='josh' WHERE id='1' and lastName='watergate'
UPDATE mytable SET name='bob' WHERE id='2' and lastName='bluegun'
I want to merge those 2 statements into 1.
how can I do that in a most effective way ?
thanks
I need to update more than 1 row with different condition (where clause) per row in the same table (SQL Server).
something like this:
UPDATE mytable SET name='josh' WHERE id='1' and lastName='watergate'
UPDATE mytable SET name='bob' WHERE id='2' and lastName='bluegun'
I want to merge those 2 statements into 1.
how can I do that in a most effective way ?
thanks