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. nexus和maven的安装与配置

    如果用普通用户安装就需要创建用户 属组例 groupadd configer  //创建用户组 useradd -g configer configer  //创建用户并指定用户组 passwd co ...

  2. PHP中PSR-[0-4]规范(转)

    PHP中PSR-[0-4]规范 更好排版:https://www.zybuluo.com/phper/note/65033 PHP是世界上最伟大的语言,这一点是毋庸置疑的吧.哈哈哈哈哈哈 .这个霸气的 ...

  3. 关闭或开启memory_target

    对于Oracle数据库内存参数配置大小,一般满足如下规则 sga_target + pga_aggregate_target < memory_target <=memory_max_ta ...

  4. Keepalived 进程无法关闭

    操作系统:SLES12sp2 keepalived版本:1.2.12 问题描述: 使用命令"systemctl stop keepalived" 无法关闭keepalived,使用 ...

  5. ZOJ 1002:Fire Net(DFS+回溯)

    Fire Net Time Limit: 2 Seconds      Memory Limit: 65536 KB Suppose that we have a square city with s ...

  6. 四则运算可能需要注意的地方V1.1

    作业:https://edu.cnblogs.com/campus/nenu/SWE2017FALL/homework/997 文档下载:https://coding.net/u/Dawnfox/p/ ...

  7. Example [mybatis] 的用法

    example.or() .andField1EqualTo() .andField2IsNull(); example.or() .andField3NotEqualTo() .andField4I ...

  8. PureComponent的作用及一些使用陷阱

    默认渲染行为的问题 在React Component的生命周期中,有一个shouldComponentUpdate方法.这个方法默认返回值是true. 这意味着就算没有改变组件的props或者stat ...

  9. UTF-8 Invalid Byte Sequences

    Chances are, some of you have run into the issue with the invalid byte sequence in UTF-8 error when ...

  10. linux忘记root密码

    在选择系统界面选中要修改的系统(我的就是默认的第一个),按e建进入修改,在修改界面一直下到文件末尾,在末尾前一行左右,找到UTF-8那一行,在这一行敲一个空格,然后打init=/bin/sh 修改完成 ...