Home > SQL Server Questions > difference between COUNT() and COUNT_BIG() – MSDN TSQL forum

difference between COUNT() and COUNT_BIG() – MSDN TSQL forum

September 28, 2010 Leave a comment Go to comments

 
–> Question:

What is the difference between COUNT() and COUNT_BIG() in SQL Server ?
 

–> Shaahs Answer:

COUNT() and COUNT_BIG() are similar in functionality, but COUNT() always returns INT and COUNT_BIG() returns BIG INT.

MSDN reference
 

–> My Answer:

Also COUNT() can not be used while creating Indexed Views.

And COUNT_BIG() is a mandatory requirement to include in Indexed Views.


Advertisement
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: