SELECT

  • Comments posted to this topic are about the item SELECT

  • I recognised the attempt to insert null and hence picked 2,0 because that's what the two select statements return: 2 and 0. It's the insert statement that fails.

  • sam.dahl (10/4/2012)


    I recognised the attempt to insert null and hence picked 2,0 because that's what the two select statements return: 2 and 0. It's the insert statement that fails.

    +1

    I also misunderstood the question.

    ~ 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 (10/4/2012)


    sam.dahl (10/4/2012)


    I recognised the attempt to insert null and hence picked 2,0 because that's what the two select statements return: 2 and 0. It's the insert statement that fails.

    +1

    I also misunderstood the question.

    well , I got it right .. I guess ; I didn't consider the select statement returning nothing..

    But I would say , 2,0 should be the valid answer , since that is actually being asked in the question..

    +1

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • Lokesh Vij (10/4/2012)


    sam.dahl (10/4/2012)


    I recognised the attempt to insert null and hence picked 2,0 because that's what the two select statements return: 2 and 0. It's the insert statement that fails.

    +1

    I also misunderstood the question.

    Don't worry, this question (or perhaps the "answer") will be fixed in Service Pack 1.

    :Whistling:


    Cheers,
    - Mark

  • mccork (10/4/2012)


    Lokesh Vij (10/4/2012)


    sam.dahl (10/4/2012)


    I recognised the attempt to insert null and hence picked 2,0 because that's what the two select statements return: 2 and 0. It's the insert statement that fails.

    +1

    I also misunderstood the question.

    Don't worry, this question (or perhaps the "answer") will be fixed in Service Pack 1.

    :Whistling:

    Cool thanks :Wow:

    ~ 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

  • mccork (10/4/2012)


    Lokesh Vij (10/4/2012)


    sam.dahl (10/4/2012)


    I recognised the attempt to insert null and hence picked 2,0 because that's what the two select statements return: 2 and 0. It's the insert statement that fails.

    +1

    I also misunderstood the question.

    Don't worry, this question (or perhaps the "answer") will be fixed in Service Pack 1.

    :Whistling:

    Cool , good one ...:-D:w00t::smooooth:

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • Thanks - easy question to finish the week off with

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • I *knew* when I saw the answer options that there would be a possible source of confusion here.

    Yes, the insert into the second table will fail. But that insert is not batch-aborting. The second select will still run, and because the insert has failed, it will return an empty set.

    The answer is: "How many rows are returned from the selects listed above?" (emphasis mine). The only correct answer is 2,0, since the number of rows returned by the second row is not equal to "error" (which is not even a number), but "zero".


    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/

  • And let the rants begin! 🙂

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

  • Heh...Seems "correct" answer is "incorrect". If the question is about how many rows are returned, the answer is 2,0. Period.:cool:


    Sujeet Singh

  • The question is about the select, NOT the insert. Answer is 2,0. Bad question!! Give me my point!

  • The right answer isn't the right one? The selects give 2 and 0 rows back. Arghhh..

  • I made the same mistake as the question setter, hence got it right! 😀

  • kyliedude (10/5/2012)


    Give me my point!

    If points are that important for you, you can have one of mine. Heck, you can have all of mine. Last time I checked, the grocery still didn't accept my points as payment, and I also still haven't seen any job ads where SQLServerCentral points are a job requirement.

    Or, put differently: "loosen up, people!"


    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/

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

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