Global Variables

Global variables are system-supplied, predefined variables, and are a Transact-SQL extension. Global variables are distinguished from local variables by the two @ signs preceding their names—for example, @@error. The two @ signs are considered part of the identifier used to define the global variable.

Users cannot create global variables and cannot update the value of global variables directly in a select statement. If a user declares a local variable that has the same name as a global variable, that variable is treated as a local variable.

See, Global Variables, in the Reference Manual: Building Blocks for a complete list of the global variables.