Developers often refer to the @@Functions as global variables. In fact, they don't really behave like variables. You cannot assign values to them or work with them as you would work with normal variables. Instead, they behave as functions that return various types of information about what is going on in SQL Server.
The @@RowCount variable returns the number of rows returned by a selected statement or affected by a statement that modifies data. It returns 0 if no values are returned by the SELECT statement or modified by the action query. Here's an example:
SELECT CustomerID, CompanyName FROM Customers WHERE Country = 'USA' SELECT @@RowCount as NumUSACusts
The example selects all customers in the country of ...