• wall str33t (3/11/2010)


    A better question might be is there a difference between count(*) and count(col).

    Many people don't know the subtleties between them.

    Rather than re-answer that question, I'll provide a link to where you can find that information:

    http://www.sqlservercentral.com/Forums/FindPost879366.aspx -- My post explaining how COUNT_BIG works

    http://www.sqlservercentral.com/Forums/FindPost879538.aspx -- Oleg's excellent test setup illustrating my explanation

    These are from the discussion of the March 9 QotD by agrawal.prakriti, about COUNT_BIG. The only difference between COUNT_BIG and COUNT is that COUNT_BIG returns a BIGINT rather than an INT. For official reference:

    http://msdn.microsoft.com/en-us/library/ms190317.aspx -- Microsoft's documentation for COUNT_BIG

    http://msdn.microsoft.com/en-us/library/ms175997.aspx -- Microsoft's documentation for COUNT

    Feel free to write and submit a QotD based on this info.