Multiple Column update with 1 Query

  • Hello all, Oracle gives you the ability to update multiple columns in a table by running a multiple column query.  How is this done in SQL Server 2000?

    Oracle:

    UPDATE Table1

    SET(Col1, Col2)=(SELECT Col3, Col4 FROM Table2 WHERE ColumnX="xx")

    WHERE columnY="yy"

    Any Ideas?  Thanks.  Nate.

  • UPDATE Table1

    SET Col1 = Col3, Col2 = Col4

    FROM Table2

    WHERE Table2.ColumnX="xx" AND Table1.columnY="yy"

    _____________
    Code for TallyGenerator

  • Thank you much.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply