November 24, 2011 at 11:31 pm
Comments posted to this topic are about the item MERGE with ANSI
November 25, 2011 at 1:39 am
Given the MERGE statement below, which is completely correct for SQL Server 2005 and later
The MERGE statement is only available in SQL Server 2008 and later.
I don't think this has any bearing on the low percentage of people getting this right, though...!
November 25, 2011 at 1:54 am
This was removed by the editor as SPAM
November 25, 2011 at 2:20 am
Stewart "Arturius" Campbell (11/25/2011)
This was quite a tough one.Learned a fair bit about the origin of the MERGE statement from this.
I definitely second this.
Some may argue it's cheating to do some reading (researching) prior to answering the QotD, but I came across this interesting and helpful blog post by one Hugo Kornelis :-).
Hence a double thank you to Hugo for an excellent QotD on MERGE following the ANSI standard, and for sharing your extensive knowledge with everybody on the web.
You all have a great weekend,
Michael
November 25, 2011 at 2:37 am
My brain hurts...
November 25, 2011 at 2:41 am
I came across this interesting and helpful blog post by one Hugo Kornelis :-).
Hence a double thank you to Hugo for an excellent QotD on MERGE following the ANSI standard, and for sharing your extensive knowledge with everybody on the web.l
Thank you Michael (and Hugo!) for that very useful link.
Despite my minor bit of pedantry about the SQL versions, I second your thanks to Hugo - I always read his contributions with interest and often learn from them. 🙂
November 25, 2011 at 3:20 am
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! 😀
November 25, 2011 at 9:11 am
Good question and good explanation - and thanks especially for the link to a late draft of the SQL 2003 standard.
It was a bit hard for a Friday question, just when people are getting ready to relax for the weekend (careless scheduling by Steve there, or did he do it on purpose?). I spent a long time racking my brain to try to remember which was the fourth box to tick - after I had ticked three boxes all the others seemed as if they ought to be left unticked; and then I clicked that only UPDATE was allowed in WHEN MATCHED, not DELETE, so as I had already ticked WHEN NOT MATCHED BY SOURCE I logically had to tick DELETE as my fourth choice.
Definitely good excercise for the grey matter.
Tom
November 25, 2011 at 9:20 am
martin.whitton (11/25/2011)
The MERGE statement is only available in SQL Server 2008 and later.I don't think this has any bearing on the low percentage of people getting this right, though...!
Actually the percentage doesn't seem too bad - up to now 12% got it right; that's a bit more than four times as many as would be expected if everyone ticked 4 boxes chosen at random from the seven boxes provided. There have been much worse responses to other questions.
But I agree this one was pretty hard.
Tom
November 25, 2011 at 11:57 am
Nice question Hugo, had to do some research before answering this one and I still was surprised that I got it right. I think my brain now hurts too much to get anything else done today. Happy Friday!
November 27, 2011 at 11:27 pm
Tough one, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 28, 2011 at 12:08 am
A very tough question....
November 28, 2011 at 9:18 am
I have unbfair advantage: MERGE is my daily bread. 😉
Thanks for this interesting question!
November 28, 2011 at 9:26 am
Thanks Hugo
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 28, 2011 at 4:10 pm
thanks Hugo!
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply