NO COUNT

  • Comments posted to this topic are about the item NO COUNT

    Thanks,
    Shiva N
    Database Consultant

  • This was removed by the editor as SPAM

  • Nice question, thanks.

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

  • Extremely easy!

    The answer is in the title!

    πŸ˜€

  • Carlo Romagnano (12/11/2014)


    Extremely easy!

    The answer is in the title!

    πŸ˜€

    The answer might be in the title, but as a newbie I went through my usual process of reading the question, picking an answer after researching the question if needs be, then running the code to double check before actually selecting an answer. However when I did this, I got some data back so I changed my answer and got it wrong. Can anybody suggest why? I'm running 2012.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    β€”Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • BWFC (12/11/2014)


    Carlo Romagnano (12/11/2014)


    Extremely easy!

    The answer is in the title!

    πŸ˜€

    The answer might be in the title, but as a newbie I went through my usual process of reading the question, picking an answer after researching the question if needs be, then running the code to double check before actually selecting an answer. However when I did this, I got some data back so I changed my answer and got it wrong. Can anybody suggest why? I'm running 2012.

    The question is what would be the output in the message pane, not the number of rows returned in the results pane.. Judging by the number of people also going for the number of actual records returned (including myself!) many are tripping up on this question and mis-reading the intention

  • D'OH!!!!!!!!!!!!!!!! :pinch:


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    β€”Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Missread the intention of the query. Knew NOCOUNT would return no counts, but thought it was about what should have been returned! Doh!!!

    Nice question and interesting use of the two values clauses.

  • Arthur Olcot (12/11/2014)


    BWFC (12/11/2014)


    Carlo Romagnano (12/11/2014)


    Extremely easy!

    The answer is in the title!

    πŸ˜€

    The answer might be in the title, but as a newbie I went through my usual process of reading the question, picking an answer after researching the question if needs be, then running the code to double check before actually selecting an answer. However when I did this, I got some data back so I changed my answer and got it wrong. Can anybody suggest why? I'm running 2012.

    The question is what would be the output in the message pane, not the number of rows returned in the results pane.. Judging by the number of people also going for the number of actual records returned (including myself!) many are tripping up on this question and mis-reading the intention

    Actually the question is "How many rows will be affected in the Message Pane" which of course is very sloppy phrasing that doesn't really make any sense; perhaps most people will correctly guess what it was intended to mean (you have, clearly, and I did, in fact probably nearly half of the people who have tried it did as nearly half the answers so far are correct) but others may be confused by it.

    This is a nice question, but would have been a much better question if it had been worded correctly.

    Tom

  • Arthur Olcot (12/11/2014)


    BWFC (12/11/2014)


    Carlo Romagnano (12/11/2014)


    Extremely easy!

    The answer is in the title!

    πŸ˜€

    The answer might be in the title, but as a newbie I went through my usual process of reading the question, picking an answer after researching the question if needs be, then running the code to double check before actually selecting an answer. However when I did this, I got some data back so I changed my answer and got it wrong. Can anybody suggest why? I'm running 2012.

    The question is what would be the output in the message pane, not the number of rows returned in the results pane.. Judging by the number of people also going for the number of actual records returned (including myself!) many are tripping up on this question and mis-reading the intention

    It isn't. Here's the question again: "How many rows will be affected in the Message Pane from the below query?" and the answer of course is 1. That single row contains the text "One row(s) affected" or whatever.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Tricky question, but very nice as well, I was about to choose the (1 row(s) affected) option, but re-read the qusetion slowly, got it right.

    Thanx πŸ™‚

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Carlo Romagnano (12/11/2014)


    Extremely easy!

    The answer is in the title!

    πŸ˜€

    +1 πŸ˜‰

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Stewart "Arturius" Campbell (12/10/2014)


    Interesting question, thanks Shiva

    Never thought of doing an implicit cross join of two VALUES constructs before...

    Same here. That's what caught my attention.

  • I'm to the point now if Shiva N posts the question, I'm skipping it.

  • The message pane was the clue that we needed to be in grid mode, not text mode. Then seeing the no count on made the answer jump out for me. I use that feature in most of my stored procedures.

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

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