Site icon Database Tutorials

COUNT_BIG Function in SQL Server(TSQL)

 

The COUNT_BIG function performs the same function as the COUNT function. The only difference is that the COUNT_BIG function returns the BIGINT value while the COUNT function returns int value.

Let’s make examples for a better understanding of COUNT_BIG Function.

Example:

First, we create a table with the help of the following script and add a few records into this table.

Let’s calculate the number of records in the table with one of the following queries: (Both queries return the same result. If you type a column name instead of 1 or *, null records are not calculated.)

or

Calculate how many products each person has by grouping table by [Name] column:

Exit mobile version