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.

Set ARITHABORT Option设置为ON的更多相关文章

  1. easyui中的option设置selected没有效果

    在mvc中,使用了easyUI框架,然后我点击添加新消息的时候弹窗一个新窗口,添加信息.却发现我的select一直无法设置默认状态,jq选中,还是直接在添加一条请选择的option都没办法选中,网络上 ...

  2. HTML中select的option设置selected="selected"无效的解决方案

    今天遇到了一个奇葩问题,写HTML时有个select控件,通过设置option的selected="selected"居然无效,但是在其他浏览器是可以的,问了一下Google大神, ...

  3. IDEA 的VM Option设置加快页面的加载速度

    VM Option的设置: -Xms1024M -Xmx2048M -XX:PermSize=128M -XX:MaxPermSize=256M

  4. HTML中select的option设置selected="selected"无效的解决方式

    今天遇到了一个奇葩问题,写HTML时有个select控件.通过设置option的selected="selected"竟然无效,可是在其它浏览器是能够的.问了一下Google大神, ...

  5. IjkPlayer播放器秒开优化以及常用Option设置

    https://blog.csdn.net/shareus/article/details/78585260 ijkplayer点播和直播视频 问题 解决及优化  https://blog.csdn. ...

  6. Amber中的一些option设置及名词

    详细请见AMBER官方文档第18章第6节(18.6) Amber16.pdf The settings can be summarized as follows: imin=1  Choose a m ...

  7. Fiddler在fiddler option设置还是抓不了HTTPS包解决办法

    1:请在“运行”,即下面这个地方输入certmgr.msc并回车,打开证书管理. 打开后,请点击操作--查找证书,如下所示: 然后输入“fiddler”查找所有相关证书,如下所示: 可以看到,我们找到 ...

  8. mysql用户权限设置

    1.创建新用户 通过root用户登录之后创建 >> grant all privileges on *.* to testuser@localhost identified by &quo ...

  9. jQuery根据文本设置select选中失效问题

    $("#select_id option[text='jQuery']").attr("selected", true) 失效 text是Jquery关键字,不 ...

随机推荐

  1. java ip 正则表达式

    private static boolean isBoolIp(String ipAddress) { String ip = "(?:(?:25[0-5]|2[0-4][0-9]|[01] ...

  2. Python之路PythonNet,第三篇,网络3

    pythonnet   网络3 udp 通信 recvfrom sendtofork 多进程并发threading 多线程并发socketserver 系统模块 套接字的属性 setsockopt g ...

  3. [LeetCode&Python] Problem 268. Missing Number

    Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missin ...

  4. Unity3D 重写下拉菜单/Dropdown组件、开启每个按钮可用

    Override Dropdown Component 本文提供全流程,中文翻译. Chinar 坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) ...

  5. 数据类型int、float、str、list、dict、set定义及常用方法汇总

    数据类型int:记录整数事物状态 可变不可变:值不可变类型,改变变量值实则是改变了变量的指向 int():功能:1.工厂函数, i = 5 <==> i = int(5) 2.强制类型转换 ...

  6. rest-framework之分页器

    rest-framework之分页器 本文目录 一 简单分页(查看第n页,每页显示n条) 二 偏移分页(在第n个位置,向后查看n条数据) 三 CursorPagination(加密分页,只能看上一页和 ...

  7. priority_queue的基本用法

    #include<bits/stdc++.h> using namespace std; int main() { ]; ;i<=;i++) a[i]=i; sort(a+,a++, ...

  8. This Jenkins instance appears to be offline

    tomcat 方式启动jenkins时,报:This Jenkins instance appears to be offline and offers options to "Config ...

  9. 多线程线性 lock

    有时我们lock一段代码或许要根据某个变量的值,值相同则不允许有两个或以上的方法并行运行,我在工作中就遇到了,有100个值,相同的参数值不能并行运行. 还有就是一个被lock的方法递归调用会不会死锁, ...

  10. 高性能kv存储之Redis、Redis Cluster、Pika:如何应对4000亿的日访问量?

    一.背景介绍 随着360公司业务发展,业务使用kv存储的需求越来越大.为了应对kv存储需求爆发式的增长和多使用场景的需求,360web平台部致力于打造一个全方位,适用于多场景需求的kv解决方案.目前, ...