Logo 
Search:

SQL Server Articles

Submit Article
Home » Articles » SQL Server » System FunctionsRSS Feeds

ROWCOUNT_BIG Function

Posted By: Sarita Patel     Category: SQL Server     Views: 5507

This article explains about ROWCOUNT_BIG function in sql server with examples.

ROWCOUNT_BIG function returns number of rows affected by last executed statement. It works same as @@ROWCOUNT except the return type differs.  

This variable is set to 0 by any statement that does not return rows, such as an IF statement.

If the table has more than 2 billion rows, use ROWCOUNT_BIG().


Syntax of ROWCOUNT_BIG Function :

ROWCOUNT_BIG()

Return type of ROWCOUNT_BIG function is a bigint.




Examples of ROWCOUNT_BIG Function :

Example 1 : Use of ROWCOUNT_BIG function in select clause 

SELECT ProductName, UnitPrice
FROM    Products

SELECT ROWCOUNT_BIG()


Output
76

Above example returns total row count returned by last statement. 
  
Share: 


Didn't find what you were looking for? Find more on ROWCOUNT_BIG Function Or get search suggestion and latest updates.

Sarita Patel
Sarita Patel author of ROWCOUNT_BIG Function is from United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!