Re: common UPDATE syntax for SqlServer and Oracle

From: Jarl Hermansson <jarl_at_mimer.com>
Date: 26 Nov 2004 06:40:56 -0800
Message-ID: <2aaa8682.0411260640.e7c66f8_at_posting.google.com>


"Jan van Veldhuizen" <jan_at_van-veldhuizen.nl> wrote in message news:<41a6fed9$0$78279$e4fe514c_at_news.xs4all.nl>...
> Thanks. I'm going to test that.
>
> That syntax will work with one column to be updated.
> What if I have to columns?
>
> I think the oracle sql will support something like:
> UPDATE Table1
> SET (city_id, another_column) =
> (SELECT T2.id, other_column FROM etctera...
>
> But that no standard SqlServer syntax as far as I know.

Jan,

The multi-column UPDATE you describe above is actually included in the SQL-2003 standard. (The non-Core feauture T641 - "Multiple column assignment")

Regards,
Jarl Received on Fri Nov 26 2004 - 15:40:56 CET

Original text of this message