May 16, 2013 at 10:12 pm
Comments posted to this topic are about the item INSERT
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
May 16, 2013 at 10:13 pm
Easy one for Friday morning. Thanks Kapil 🙂
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
May 16, 2013 at 11:14 pm
Lokesh Vij (5/16/2013)
Easy one for Friday morning. Thanks Kapil 🙂
Nice question hints a good weekend. Thanks kapil 🙂
Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
May 17, 2013 at 1:47 am
Good one, Kapil, thank you for the post.
(I actually learnt this one of the previous/old Qtods where the computed col will change into regular col when the table used with SELECT..INTO.)
This week has been very interesting QToD wise... 🙂
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
May 17, 2013 at 1:51 am
This was removed by the editor as SPAM
May 17, 2013 at 1:52 am
Nice!
Igor Micev,My blog: www.igormicev.com
May 17, 2013 at 3:22 am
Nice one .
Malleswarareddy
I.T.Analyst
MCITP(70-451)
May 17, 2013 at 3:31 am
Nice question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
May 17, 2013 at 5:17 am
Nice straightforward question.
Same sort of topic as last Friday's, but one big difference: this time BOL documents the behaviour.
Tom
May 17, 2013 at 6:39 am
Thank you for the question.
May 17, 2013 at 10:23 am
Nice one - thanks, Kapil!
May 17, 2013 at 11:10 am
Good question.
-----------------
Gobikannan
May 18, 2013 at 1:52 am
Interesting: After I decided on my answer of the first insert running ok, and the second insert failing, I fired up my trusty copy of SQL Server Express 2012 and ran your question in my test area to verify it. This resulted in BOTH inserts failing. So, trusting software over wetware, I selected the answer of having both fail. Oh well!
May 18, 2013 at 2:16 am
sea4stars (5/18/2013)
Interesting: After I decided on my answer of the first insert running ok, and the second insert failing, I fired up my trusty copy of SQL Server Express 2012 and ran your question in my test area to verify it. This resulted in BOTH inserts failing. So, trusting software over wetware, I selected the answer of having both fail. Oh well!
You probably executed thee two statements as a single batch. Since the error you get is raised at compile time and SQL Server always compiles the entire batch before starting execution, the ffect would be that none of the statements run. However, you get only a single error message, refering to a single statement. So the answer option "both statements will throw an error" is definitely not correct.
When I answered this question (yesterday), I knew that neither statement would execute when sent as a single batch, but since there was no answer option that described this behaviour, I knew the author intended the statements to be executed independently. (If the answer option had been phrased as "neither statement will execute successfully", I would indeed have been confused, and forced to make a 50/50 guess as to the author's intentions).
May 20, 2013 at 1:32 am
Nice one.....
Viewing 15 posts - 1 through 15 (of 30 total)
You must be logged in to reply to this topic. Login to reply