INSERT

  • 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/

  • Easy one for Friday morning. Thanks Kapil 🙂

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • 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 !!!

  • 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.

  • This was removed by the editor as SPAM

  • Nice!

    Igor Micev,My blog: www.igormicev.com

  • Nice one .

    Malleswarareddy
    I.T.Analyst
    MCITP(70-451)

  • Nice question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Nice straightforward question.

    Same sort of topic as last Friday's, but one big difference: this time BOL documents the behaviour.

    Tom

  • Thank you for the question.

  • Nice one - thanks, Kapil!

  • Good question.

    -----------------
    Gobikannan

  • 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!

  • 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).


    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/

  • Nice one.....

Viewing 15 posts - 1 through 15 (of 30 total)

You must be logged in to reply to this topic. Login to reply