• Thanks, all, for the kind words! I am glad you all find my questions entertaining and informative.

    martin.whitton (11/25/2011)


    The MERGE statement is only available in SQL Server 2008 and later.

    Oops! :blush: Stupid mistake - sorry 'bout that!

    Stewart "Arturius" Campbell (11/25/2011)


    I think the main reason for the poor score rate is that the SQL ANSI:2003 definitions are not readily available.

    I included a link to a freely available version (of a late draft, not the official final version) in the answer's explanation. When I first found this link, I immediately downloaded it to my computer for fear of it being removed. When I submitted the question, I had to use Google to re-find the link.

    As far as I know, there are no newer versions of the ANSI SQL standard that are freely available (unfortunately).

    By the way - after submitting this question, I found that most of the non-SQL:2003 stuff in MERGE was not added by Microsoft for SQL Server only, but is defined in SQL:2008. So I was very glad that I included the version of the standard in the question! 😀


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/