RSS

Difference between Count() and Count_Big() Funiction

20 Jul

In our Query Life when we need to get the Count of any Record in our Database Mostly we Use the COUNT() Aggregate Function the

Question Now SQL Server Have another  Aggregate Function COUNT_BIG() i asked my Self SQL Server Team Created this Function Whiteout any bin fits ……….. The answer is No . COUNT() and COUNT_BIG() it’s the Same Aggregate Function in the Use The Main Different between the two Aggregate Function it :

Count  Aggregate Function Return Int data type value .

COUNT_BIG()  Aggregate Function Return BigInt data type value .

So if you Have Millions Record in your table and you need to Return the Count of this Record when you use the Count() Function it will Return Error but the Count_Big() Function it will Work with you Simply in this Case .

Count() Aggregate Function :

Select Count(Column_Name) from Table_Name

Count_Big Aggregate Function :

Select Count_Big (Column_Name) From Table Name
 
Leave a comment

Posted by on July 20, 2013 in General topics

 

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 )

Google+ photo

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

Connecting to %s