Behavior if Both ARITHABORT and ARITHIGNORE Are Set ON

When using version 2.50.0121 or later of the Microsoft® SQL Server™ ODBC driver, if both the ARITHABORT and ARITHIGNORE query-processing options are set ON, ARITHABORT takes precedence.

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

SET ARITHABORT ON

SET ARITHIGNORE ON

GO

  

Stored procedures that issue a SET ARITHIGNORE ON statement will still have clients exhibit the SET ARITHABORT ON behavior if the client had set ARITHABORT on before calling the stored procedure.

Procedures can do the following to ensure that ARITHIGNORE will always be active regardless of the client setting for ARITHABORT:

CREATE PROCEDURE example AS

SET ARITHABORT OFF

SET ARITHIGNORE ON

-- Statements making up the stored procedure go here.

GO

  

Whenever a SET statement is executed in a stored procedure, the new setting is active only until the procedure completes. When the procedure completes, the connection's setting for that option will go back to what it was before the procedure was executed. With the sample code above, the ARITHABORT option is set OFF for the life of the procedure so that the ARITHIGNORE option will be active. It then resets to any setting the client application wants when the procedure completes.

See Also
SET ARITHABORT SET ARITHIGNORE


(c) 1988-98 Microsoft Corporation. All Rights Reserved.