SQL Server SESSIONPROPERTY() Function
THE WORLD'S LARGEST WEB DEVELOPER SITE

SQL Server SESSIONPROPERTY() Function

❮ SQL Server Functions

Example

Return the setting for a specified option of a session:

SELECT SESSIONPROPERTY('ANSI_NULLS');

Definition and Usage

The SESSIONPROPERTY() function returns the setting for a specified option of a session.

Syntax

SESSIONPROPERTY(option)

Parameter Values

Parameter Description
option Required. The option to retrieve the session settings for. Can be one of the following values:
Option Description
ANSI_NULLSSQL-92 compliant behavior of NULL values. 1=ON, 0=OFF
ANSI_PADDINGSQL-92 compliant behavior of padding and trailing spaces in storage of character and binary columns. 1=ON, 0=OFF
ANSI_WARNINGSSQL-92 compliant behavior of warnings and error messages. 1=ON, 0=OFF
ARITHABORTAbort queries when an overflow or divide-by-error occurs. 1=ON, 0=OFF
CONCAT_NULL_YIELDS_NULLConcatenated results (that are NULL) are treated as NULL rather than empty strings. 1=ON, 0=OFF
NUMERIC_ROUNDABOUTWarnings and error messages are raised when rounding causes a loss of precision. 1=ON, 0=OFF
QUOTED_IDENTIFIERSQL-92 compliant behavior of quotation marks to delimit literal strings and identifiers. 1=ON, 0=OFF

❮ SQL Server Functions