Transact-SQL Reference
SESSIONPROPERTY
Returns the SET options settings of a session.
Syntax
SESSIONPROPERTY ( option )
Arguments
option
Is the current option setting for this session. option may be any of the following values.
Option | Description |
---|---|
ANSI_NULLS | Specifies whether the SQL-92 compliant behavior of equals (=) and not equal to (<>) against null values is applied.
1 = ON |
ANSI_PADDING | Controls the way the column stores values shorter than the defined size of the column, and the way the column stores values that have trailing blanks in character and binary data.
1 = ON |
ANSI_WARNINGS | Specifies whether the SQL-92 standard behavior of raising error messages or warnings for certain conditions, including divide-by-zero and arithmetic overflow, is applied.
1 = ON |
ARITHABORT | Determines whether a query is terminated when an overflow or a divide-by-zero error occurs during query execution.
1 = ON |
CONCAT_NULL_YIELDS_ NULL |
Controls whether concatenation results are treated as null or empty string values.
1 = ON |
NUMERIC_ROUNDABORT | Specifies whether error messages and warnings are generated when rounding in an expression causes a loss of precision.
1 = ON |
QUOTED_IDENTIFIER | Specifies whether SQL-92 rules regarding the use of quotation marks to delimit identifiers and literal strings are to be followed.
1 = ON |
<Any other string> | NULL = Invalid input |
Return Types
sql_variant
Remarks
SET options are figured by combining server-level, database-level, and user-specified options.
Examples
This example returns the setting for CONCAT_NULL_YIELDS_NULL option.
SELECT SESSIONPROPERTY ('CONCAT_NULL_YIELDS_NULL')