A user or client application can query a global variable to
find and view the property and processing values that affect that
client connection.
A global variable represents either the current value of a set statement, or
information about the processing state of a connection.
Global variables are
preceded by two “@@” characters and are not case-sensitive. To query a
global variable, issue:
select @@variable_name
where variable_name is the name
of the relevant global variable.
Other rules that apply:
-
All global variables can be queried regardless of the SQL
transformation mode in effect for the
connection.
-
The select statement must be the only
one in a batch.
-
The statement can be terminated with a semicolon.
Example 1:
SQL statement to query a global variable for the Client Interaction
property,
SendWarningMessages:
select @@SendWarningMessages