MSDN注释中提到,应该总是将Set ARITHABORT Option设置为ON,原因有四:

1,如果SSMS和application client的设置不同,那么会导致application client使用不同的Query plan。

You should always set ARITHABORT to ON in 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 is ON. Client applications setting ARITHABORT to OFF can receive different query plans making it difficult to troubleshoot poorly performing queries. That is, the same query can execute fast in management studio but slow in the application. When troubleshooting queries with Management Studio always match the client ARITHABORT setting.

2,如果将SET ARITHABORT 设置为OFF,当出现Arith abort时,SQL Server使用默认值替换,可能会导致异常。

如果将SET ARITHABORT 设置为false,在执行insert,delete或update命令时,如果出现数学计算错误,溢出,被0除,SQL Server会将表达式的最终结果替换为null。在逻辑表达式,如果出现arith abort,那么逻辑表达式将返回false。

During expression evaluation when SET ARITHABORT is OFF, if an 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 an abort error occurs during the evaluation of the Boolean condition of an IF statement, the FALSE branch will be executed.

3,如果将SET ARITHABORT 设置为 ON,当出现Arith abort时,SQL Server将会终止语句的执行。

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

4,在创建和更新computed index(含有computed column)或 Indexed views时,必须将Set ARITHABORT 选项设置为ON

SET ARITHABORT must be ON when you are creating or changing indexes on computed columns or indexed views. If SET ARITHABORT is OFF, CREATE, UPDATE, INSERT, and DELETE statements on tables with indexes on computed columns or indexed views will fail.

SET ARITHABORT { 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.

最新文章

  1. [原创] NetBean开发c++程序指南1- 加入c++项目文件夹
  2. win7下Oracle 11的安装
  3. Fiddler 过滤 css,图片等请求url 正则表达式
  4. layPage异步分页
  5. SSLSocket实现服务端和客户端双向认证的例子
  6. hdu 4919 Exclusive or
  7. 利用webBrowser获取框架内Html页面内容
  8. leetcode第32题--Search in Rotated Sorted Array
  9. block、块级作用域
  10. (二十六)静态单元格(Cell)
  11. mysql性能优化之数据库级别优化--优化sql语句
  12. rabbitmq 启动报错 Failed to get nic info
  13. C# MVC+EF—结构搭建
  14. JAVA8-待续
  15. 【学习笔记】--- 老男孩学Python,day6 字典
  16. Thread start()方法和run()方法的区别
  17. Ubuntu下安装java
  18. SD341X-SD343H蜗轮传动伸缩蝶阀厂家,SD341X-SD343H蜗轮传动伸缩蝶阀价格 - 专题栏目 - 无极资讯网
  19. vue+node+mongoDB 火车票H5(四)---完成静态页面
  20. Glib学习笔记(四)

热门文章

  1. viewport是左下角开始的
  2. ERROR: gnu-config-native-20150728+gitAUTOINC+b576fa87c1-r0 do_unpack: Function failed: Fetcher failure: Fetch command failed with exit code 128, output: fatal: the '--set-upstream' option is no longer
  3. 【Leetcode】292. Nim Game
  4. Mac os fatal error: 'numpy/arrayobject.h' file not found
  5. re.compile
  6. CodeForces - 710F:String Set Queries (二进制分组 处理 在线AC自动机)
  7. HDU5950 Recursive sequence (矩阵快速幂加速递推) (2016ACM/ICPC亚洲赛区沈阳站 Problem C)
  8. js 关于本地文件的处理
  9. PTA——念数字
  10. Blender节点笔记