top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

@@ROWCOUNT - ROWCOUNT Function in SQL?

+2 votes
65 views

This article explains about @@ROWCOUNT function in sql server with examples.

@@ROWCOUNT function returns number of rows affected by last executed statement.

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 Function :

@@ROWCOUNT

Return type of @@ROWCOUNT function is an integer.

 

Examples of @@ROWCOUNT Function :

Example 1 : Use of @@ROWCOUNT function in select clause 

SELECT ProductName, UnitPrice

FROM    Products

SELECT @@ROWCOUNT

Output

76

posted Nov 6, 2015 by Shivaranjini

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...