Table 14-6: Global variables containing session
options
Global variable
|
Description
|
@@char_convert
|
Contains 0 if character set conversion
is not in effect. Contains 1 if character set conversion is in effect.
|
@@client_csexpansion
|
Returns the expansion factor used when
converting from the server character set to the client character
set. For example, if it contains a value of 2, a character in the server
character set could take up to twice the number of bytes after translation
to the client character set.
|
@@cursor_rows
|
A global variable designed specifically
for scrollable cursors. Displays the total number of rows in the
cursor result set. Returns the value –1:
|
@@datefirst
|
Set using set datefirst n where n is
a value between 1 and 7. Returns the current value of @@datefirst,
indicating the specified first day of each week, expressed as tinyint.
The default value in Adaptive Server is Sunday (based on the
us_language default), which you set by specifying set
datefirst 7 . See the datefirst option
of the set command for more information on settings
and values.
|
@@isolation
|
Contains the current isolation level
of the Transact-SQL program. @@isolation takes
the value of the active level (0, 1, or 3).
|
@@options
|
Contains a hexadecimal representation
of the session’s set options.
|
@parallel_degree
|
Contains the current maximum parallel
degree setting.
|
@@rowcount
|
Contains the number of rows affected
by the last query. @@rowcount is
set to 0 by any command that does not return rows, such as an if,
update, or delete statement. With cursors, @@rowcount represents
the cumulative number of rows returned from the cursor result set
to the client, up to the last fetch request.
|
@scan_parallel_degree
|
Contains the current maximum parallel
degree setting for nonclustered index scans.
|
@@lock_timeout
|
Set using set lock wait n. Returns
the current lock_timeout setting,
in milliseconds. @@lock_timeout returns
the value of n. The default value is no timeout.
If no set lock wait n is executed
at the beginning of the session, @@lock_timeout returns
-1.
|
@@textsize
|
Contains
the limit on the number of bytes of text, unitext,
or image data a select returns.
Default limit is 32K bytes for isql; the default
depends on the client software. Can be changed for a session with set
textsize.
|
@@tranchained
|
Contains the current transaction mode
of the Transact-SQL program. @@tranchained returns
0 for unchained or 1 for chained.
|