NO COUNT

  • doug.davidson

    SSCommitted

    Points: 1602

    Thank for the question. I have been using NOCOUNT in my SP for years (OJT sql development) but did not fully understand the benefit. Now at least I have a better understanding why.

  • g.britton

    SSChampion

    Points: 13689

    Reading the question literally, I would say that no rows are "affected" in the Message pane. That is, nothing happens to whatever appears in the message pane; stuff just appears and that's it. The Message pane is affected, to be sure but not the rows in the message pane. For that matter, I could dogmatically say that never, ever are rows "affected" in the message pane!

    Gerald Britton, MCSE-DP, MVPToronto PASS Chapter[/url]

  • Raghavendra Mudugal

    SSChampion

    Points: 10658

    OCTom (12/11/2014)


    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.

    +1

    We use in all SPs.

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • RK Mandava

    SSCarpal Tunnel

    Points: 4153

    nice question

  • Alvin Ramard

    SSC-Forever

    Points: 41190

    Actually, this was a badly worded question.

    The question was asking how many rows will be affected. It should have been asking what message will be displayed.

    (I got the correct answer so I'm not complaining because I got it wrong.)



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • kumar1

    Ten Centuries

    Points: 1185

    Nice one, misread the question.. I was just thinking of how many 'rows effected'...

    But It reminds me again, Read/Listen what's being asked..

  • Miles Neale

    SSChampion

    Points: 13147

    Bobby Russell (12/11/2014)


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

    Never pass up an opportunity to learn, even if it is tricky or has a twist. Your business users do this kind of thing in their responses, and requirements. The better you learn to learn what people are saying or asking, the better you will be at this.

    🙂

    Not all gray hairs are Dinosaurs!

  • kanwaldeep.sandhu

    SSC Rookie

    Points: 33

    Very bad phrasing of question, answer depends on how you read it.

  • antony-688446

    Ten Centuries

    Points: 1221

    Miles Neale (12/11/2014)


    Bobby Russell (12/11/2014)


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

    Never pass up an opportunity to learn, even if it is tricky or has a twist. Your business users do this kind of thing in their responses, and requirements. The better you learn to learn what people are saying or asking, the better you will be at this.

    🙂

    Nicely put Miles 🙂

    I am guessing that Shiva N's first language isn't English. When you (Bobby Russell) can write a perfectly worded question that isn't open to mis-interpretation in Shiva's native tongue, then you can criticise.

    Many people have managed to read the question and get the right answer. If you have difficulty understanding other people, then you need to improve your reading & interpreting skills.

  • rhythmk

    SSCertifiable

    Points: 7162

    Thanks for question.Though the verbiage is little confusing 😉

    --rhythmk
    ------------------------------------------------------------------
    To post your question use below link

    https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
    🙂

  • rhythmk

    SSCertifiable

    Points: 7162

    kanwaldeep.sandhu (12/11/2014)


    Very bad phrasing of question, answer depends on how you read it.

    May be you are correct but the intent of question was very good 🙂

    --rhythmk
    ------------------------------------------------------------------
    To post your question use below link

    https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
    🙂

  • rhythmk

    SSCertifiable

    Points: 7162

    Bobby Russell (12/11/2014)


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

    You are free to do so but may be you'll lose the opportunity to learn something new which you have not worked upon 😉

    --rhythmk
    ------------------------------------------------------------------
    To post your question use below link

    https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
    🙂

  • Ed Wagner

    SSC Guru

    Points: 286982

    rhythmk (12/11/2014)


    Thanks for question.Though the verbiage is little confusing 😉

    And you never have to deal with people who don't communicate well in the course of your daily work? Interpreting the requirements from the person who's confused and don't know what they want is a natural part of our job. Well, it's at least a part of mine. Personally, I detest ambiguity, but it's a part of life. If people giving requirements learn to communicate well, they'll get better results.

    Either way, the point of the question was valid.

  • PHYData DBA

    SSCertifiable

    Points: 7541

    The importance of SET NOCOUNT ON in the all the user defined SPs is very important to get good performance.

    False: If SET NOCOUNT ON is executed inside of every sproc with every execution you gain NOTHING and loose performance.

    If you want a true performance gain and get the added benefit of not having an extra record set (message) returned to the calling application then SET NOCOUNT at the connection level.

    You can also set this as a default connection setting for all server connections and let the user app enable row counts as needed for proper code execution and performance.

    Running any SET command during the execution of every user sproc on a server only increases the number of cores needed to support SQL execution not reduce it. You might see a small performance gain in application code with 1 to 10 users connecting. That would disappear once you connections started reaching the thousands and you TPS is over 500.

  • sqlnaive

    SSCoach

    Points: 17435

    Simple question 🙂

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

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