You are here: Re: SELECT works but UPDATE fails. ? « MsSQL Server « IT news, forums, messages
Re: SELECT works but UPDATE fails. ?

Posted by Serge Rielau on 06/08/05 05:59

Erland Sommarskog wrote:
> Any time I see someone touting the ANSI syntax for UPDATE and DELETE,
> I will reserve the right to bump in. Unless portability is a true and
> serious concern, and just theoretical "it could happen", the ANSI
> syntax has so serious problems - both in itself, and specific to
> SQL Server - that it is in my opinion poor advice to suggest it
> instead of the FROM syntax which is clearer, easier to understand,
> and usually also more performant on SQL Server.
>
Just an FYI the ANSI syntax to solve the problem is

MERGE INTO <target>
USING <source>
ON <join codition>
WHEN MATCHED THEN UPDATE SET ...

IMHO The UPDATE with the double query is tough for many users to
understand, before MERGE the UPDATE FROM problem was a FAQ in
c.d.ibm-db2. UPDATE FROM is also supported by Informix XPS, btw.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация