Files
sql-snippets/session_options-3a792d1a-98ee-4d0e-98f7-c44d4b158772.json
2023-06-12 15:56:45 +02:00

6 lines
2.3 KiB
JSON

{
"id": "3a792d1a-98ee-4d0e-98f7-c44d4b158772",
"prefix": "session_options",
"description": "show current session options",
"body": "with OPTION_VALUES as (\r\nselect\r\noptionValues.id,\r\noptionValues.name,\r\noptionValues.description,\r\nrow_number() over (partition by 1 order by id) as bitNum\r\nfrom (values\r\n(1, 'DISABLE_DEF_CNST_CHK', 'Controls interim or deferred constraint checking.'),\r\n(2, 'IMPLICIT_TRANSACTIONS', 'For dblib network library connections, controls whether a transaction is started implicitly when a statement is executed. The IMPLICIT_TRANSACTIONS setting has no effect on ODBC or OLEDB connections.'),\r\n(4, 'CURSOR_CLOSE_ON_COMMIT', 'Controls behavior of cursors after a commit operation has been performed.'),\r\n(8, 'ANSI_WARNINGS', 'Controls truncation and NULL in aggregate warnings.'),\r\n(16, 'ANSI_PADDING', 'Controls padding of fixed-length variables.'),\r\n(32, 'ANSI_NULLS', 'Controls NULL handling when using equality operators.'),\r\n(64, 'ARITHABORT', 'Terminates a query when an overflow or divide-by-zero error occurs during query execution.'),\r\n(128, 'ARITHIGNORE', 'Returns NULL when an overflow or divide-by-zero error occurs during a query.'),\r\n(256, 'QUOTED_IDENTIFIER', 'Differentiates between single and double quotation marks when evaluating an expression.'),\r\n(512, 'NOCOUNT', 'Turns off the message returned at the end of each statement that states how many rows were affected.'),\r\n(1024, 'ANSI_NULL_DFLT_ON', 'Alters the session'+char(39)+'s behavior to use ANSI compatibility for nullability. New columns defined without explicit nullability are defined to allow nulls.'),\r\n(2048, 'ANSI_NULL_DFLT_OFF', 'Alters the session'+char(39)+'s behavior not to use ANSI compatibility for nullability. New columns defined without explicit nullability do not allow nulls.'),\r\n(4096, 'CONCAT_NULL_YIELDS_NULL', 'Returns NULL when concatenating a NULL value with a string.'),\r\n(8192, 'NUMERIC_ROUNDABORT', 'Generates an error when a loss of precision occurs in an expression.'),\r\n(16384, 'XACT_ABORT', 'Rolls back a transaction if a Transact-SQL statement raises a run-time error.')\r\n) as optionValues(id, name, description)\r\n)\r\nselect *, case when (@@options & id) = id then 1 else 0 end as setting\r\nfrom OPTION_VALUES\r\nORDER BY [setting];"
}