SQL - Structured Query Language

@@ROWCOUNT Data - VIEW



@@Rowcount is returns the number of rows affected by the last statement. If the number of rows is more than 2 billion then use @@ROWCOUNT_BIG option. The following query is used to displays record update status message.

-- Example 60 --

 

USE EBusiness

GO

 

SELECT * FROM EMP

 

UPDATE EMP SET

Dept_Code = 65 WHERE Emp_Code IS NULL

IF @@ROWCOUNT = 0

PRINT 'Warning: No rows were updated'

GO

 

SELECT * FROM EMP


Query Output Screen

* * * * *


Email Your Comment To AUTHOR