Set ARITHABORT option setting to On

Source: Internet
Author: User
Tags terminates sql server management studio

As mentioned in the MSDN note, set ARITHABORT option should always be on for four reasons:

1, if the SSMs and application client settings are different, then the application client will be using a different query plan.

You should always set ARITHABORT to on your logon sessions. Setting ARITHABORT to OFF can negatively impact query optimization leading to performance issues.

The default ARITHABORT setting for SQL Server Management Studio are on. Client applications setting ARITHABORT to OFF can receive different query plans making it difficult to troubleshoot poorly Performing queries. That's, the same query can execute fast in Management Studio and slow in the application. When troubleshooting queries with Management Studio always match the client ARITHABORT setting.

2, if set ARITHABORT to OFF, when Arith abort occurs, SQL Server replaces with the default value, which can result in an exception.

If you set the set ARITHABORT to False, SQL Server will replace the final result of the expression with NULL if there is a mathematical calculation error, overflow, or 0 in the execution of the Insert,delete or UPDATE command. In a logical expression, if Arith abort occurs, the logical expression returns FALSE.

During expression Evaluation when SET ARITHABORT is OFF, if a INSERT, DELETE or UPDATE statement encounters an arithmetic Error, overflow, Divide-by-zero, or a domain error, SQL Server inserts or updates a NULL value. If the target column is not nullable, the INSERT or update action fails and the user receives an error.

If set ARITHABORT is set to OFF and a abort error occurs during the evaluation of the Boolean condition of an if statemen T, the FALSE branch would be executed.

3, if set ARITHABORT to on, SQL Server terminates execution of the statement when Arith abort occurs.

If SET ARITHABORT is on, these error conditions cause the query to terminate.

4, the Set ARITHABORT option must be set to on when creating and updating computed index (containing computed column) or Indexed views

SET ARITHABORT must is on if you is creating or changing indexes on computed columns or indexed views. If SET ARITHABORT is OFF, CREATE, UPDATE, INSERT, and DELETE statements in tables with indexes on computed columns or Inde Xed views would fail.

SET  on | OFF } []

Terminates a query when an overflow or divide-by-zero error occurs during query execution.

The setting of Set ARITHABORT is set at execute or run time and not at parse time.

Reference doc:

SET ARITHABORT (Transact-SQL)

Set ARITHABORT option setting to On

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.