Odd Man Out

  • ksatpute123

    Hall of Fame

    Points: 3325

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

  • Raghavendra Mudugal

    SSChampion

    Points: 10658

    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.

  • Koen Verbeeck

    SSC Guru

    Points: 258965

    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

  • Louis Hillebrand

    SSCarpal Tunnel

    Points: 4218

    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.

  • serg-52

    SSCrazy Eights

    Points: 9802

    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.

  • Koen Verbeeck

    SSC Guru

    Points: 258965

    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

  • Carlo Romagnano

    SSC-Insane

    Points: 21983

    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

  • ksatpute123

    Hall of Fame

    Points: 3325

    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.

  • ksatpute123

    Hall of Fame

    Points: 3325

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

    I think this is going to be an interesting discussion.

    All in good fun, anyway:-P

    +1

  • vivekjamshedpur

    Right there with Babe

    Points: 734

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

  • Toreador

    SSChampion

    Points: 11257

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

  • Koen Verbeeck

    SSC Guru

    Points: 258965

    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

  • Ed Wagner

    SSC Guru

    Points: 286982

    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.

  • tom.w.brannon

    Hall of Fame

    Points: 3956

    Agreed

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

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