• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Using the @@Functions

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.

@@RowCount

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:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint