Export (0) Print
Expand All

Behavior When ARITHABORT and ARITHIGNORE Are Set to ON

If both the ARITHABORT and ARITHIGNORE query-processing options are set to ON, ARITHABORT takes precedence.

ARITHABORT and ARITHIGNORE are two distinct options; setting one to ON does not automatically set the other to OFF. For example, if an application contains the following statements, both options are set to ON:

SET ARITHABORT ON
SET ARITHIGNORE ON
GO

When a SET statement is executed in a stored procedure, the new setting is active only until the procedure is completed. When the procedure is completed, the connection's setting for that option will go back to what it was before the procedure was executed.

The ANSI_WARNINGS setting affects query processor behavior regardless of the current settings of ARITHABORT and ARITHIGNORE.

For example, if SET ARITHABORT or SET ARITHIGNORE is set to OFF and SET ANSI_WARNINGS is set to ON, Microsoft SQL Server 2005 will still return an error message when it encounters divide-by-zero or overflow errors.

This table summarizes the behavior.

ARITHABORT ANSI_WARNINGS Behavior

ON

ON

Abort statement only.

ON

OFF

Abort batch.

OFF

ON

Abort statement only.

OFF

OFF

Continue; value is NULL.

Community Additions

ADD
Show:
© 2014 Microsoft