Home > Interview Questions > SQL Server > what is the use of @@ROWCOUNT function in SQL server?

what is the use of @@ROWCOUNT function in SQL server?

by Narain Siddharth   on 01/06/2011   Category: SQL Server   |  Level: Beginner   |  Views: 1670    |  Points: 25     |  Silver 


The @@ROWCOUNT function in SQL server is used to returns the no of rows affected by the last executed statement. Return type of @@ROWCOUNT is integer. for example, find no of rows affected when updating a rows.

UPDATE employee SET emp_salary = 500000
WHERE emp_grad = '6'

if @@ROWCOUNT > 0
//Do process



« what is the use of @@TRANCOUNT function in SQL server?
» What is the use of FIRST() function in SQL SERVER?
Post Question  |  Question Home

Recent Posts

User Responses


No response found, be the first to review this question.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts