|
Add a sentence SET ARITHABORT OFF
SET ARITHABORT {ON | OFF}
Comment
If SET ARITHABORT is ON, these error conditions will cause the query or batch to terminate. If an error occurs within a transaction, the transaction is rolled back. If SET ARITHABORT is OFF and one of these errors occurs, a warning message is displayed and the result of the arithmetic operation is assigned a null value.
Note If neither SET ARITHABORT or SET ARITHIGNORE is set, Microsoft® SQL Server&# 8482; will return NULL and a warning message after executing the query.
If SET ARITHABORT is OFF and an INSERT, DELETE, or UPDATE statement encounters an arithmetic error (overflow, division by zero, or field error) during the evaluation of the expression, SQL Server inserts or updates the NULL value. If the target column is not nullable, the insert or update operation fails and the user receives an error message. |
|