Tuesday, August 17, 2010

Update Multiple Column

MS SQL Update Multiple Column in single shot

*****************

UPDATE MyTable
SET (Col1, Col2, Col3, Col4) = (SELECT a, b, c, d FROM Mytable2 WHERE e =Mytable.Col5)
WHERE Col5 IN (SELECT d FROM Table2 )

*****************

No comments:

Post a Comment