Odd Man Out

  • Comments posted to this topic are about the item Odd Man Out

  • Thank you for the post, good one. My knowledge came back after selecting the wrong answer 🙂

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

  • I'd argue ROWCOUNT_BIG is an odd one as well, as it is not calculated over the current result set, but over the results of a previous query.

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

  • ROWCOUNT_BIG returns the number of rows affected by the last statement all the others return values in the result set itself (Aggregate or sequential)..

    for me ROWCOUNT_BIG was the odd one in this list.

  • Koen Verbeeck (11/20/2014)


    I'd argue ROWCOUNT_BIG is an odd one as well, as it is not calculated over the current result set, but over the results of a previous query.

    +1

    And note BOL doesn't list @@ROWCOUNT, ROWCOUNT_BIG() among aggregates.

  • serg-52 (11/20/2014)


    Koen Verbeeck (11/20/2014)


    I'd argue ROWCOUNT_BIG is an odd one as well, as it is not calculated over the current result set, but over the results of a previous query.

    +1

    And note BOL doesn't list @@ROWCOUNT, ROWCOUNT_BIG() among aggregates.

    It does in the 2008R2 version of that MSDN page.

    So apparently MS realized it is a mistake to list ROWCOUNT_BIG as an aggregate.

    Hence, the "correct" answer of this question is based on a mistake MS made 4 years ago.

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

  • ROWCOUNT_BIG() differs from @@rowcount only from the type.

    So, ROWCOUNT_BIG() is the correct answer. All other functions may be followed by the OVER clause.

  • This was removed by the editor as SPAM

  • I sure did a smart thing by adding the SQL SERVER 2008 R2 reference. Once again the question section works for me not in form of answers but the discussion that follows.

  • Stewart "Arturius" Campbell (11/20/2014)

    I think this is going to be an interesting discussion.

    All in good fun, anyway:-P

    +1

  • I strongly think that ROWCOUNT_BIG is Odd man out here :alien:

  • GROUPING_ID was introduced in SQL2008. The others were all available in SQL2005.

  • Toreador (11/20/2014)


    GROUPING_ID was introduced in SQL2008. The others were all available in SQL2005.

    And VARP is the only function with a name less than 5 characters! :w00t: 😎 :hehe:

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

  • As others have pointed out, there are other differences. I was hoping that the functional difference I noticed was the one he was looking for. In any even, the discussion could get lively.

  • Agreed

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

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