@@ROWCOUNT
@@ROWCOUNT is a SQL function in the Administration category. SQL Server: returns the number of rows affected by the last statement (INSERT, UPDATE, DELETE, SELECT). The syntax is SELECT @@ROWCOUNT;. It accepts see syntax. It returns rows affected by last statement. A typical example: UPDATE employees SET salary = salary * 1.1 WHERE department = 'IT'; SELECT @@ROWCOUNT AS rows_updated; -- Returns: 42 (42 rows were updated) -- Use for error handling: DELETE FROM employees WHERE id = 999; IF @@ROWCOUNT = 0 PRINT 'Employee not found'; A close relative is CREATE USER, which creates a new database user account. A close relative is GRANT, which grants specific privileges (SELECT, INSERT, UPDATE, DELETE, ALL) to a user on a database/table. A close relative is REVOKE, which removes previously granted privileges from a user. More about this category: Database administration — CREATE DATABASE, GRANT, REVOKE, SHOW, DESCRIBE.