SET ANSI_WARNINGS

SET ANSI_WARNINGS#

Specifies ISO standard behavior for several error conditions.

Syntax#

SET ANSI_WARNINGS { ON | OFF }  [;]

Remarks#

When ANSI_WARNINGS is ON (or SET ARITHABORT is ON), an overflow or divide-by-zero error cancels the query and returns an error to the client. When both options are OFF, the faulting expression evaluates to NULL instead. ANSI_WARNINGS also controls whether errors in cast and convert operations are reported or absorbed as NULL. The default for a Querona session is ON, matching the SQL Server client driver defaults.

When a query is pushed down to a SQL Server source, the session’s ANSI_WARNINGS and ARITHABORT state is applied to the source connection first, so the source evaluates these conditions with the same semantics as the Querona session.

Note

Azure Synapse dedicated SQL pools enforce both ANSI_WARNINGS and ARITHABORT ON and reject SET ... OFF. Arithmetic faults in queries pushed down to such sources always raise errors; Querona logs a warning when the session requests a state the platform cannot honor.

Permissions#

Requires membership in the public role.

See Also#