Working with @@ROWCOUNT function in Sql Server.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 794
@@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,then we can use use ROWCOUNT_BIG() function.
Return type of @@ROWCOUNT function is always an integer.

Syntax:-
@@ROWCOUNT


Examples:-
SELECT *
FROM Table1;

SELECT @@ROWCOUNT;

Output will be no of row affected.

Comments or Responses

Login to post response