Home >Database >Mysql Tutorial >快速解决SQL Server存储过程中的除零错误

快速解决SQL Server存储过程中的除零错误

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:23:291484browse

在SQL Server中凡出现除法运算的,都会出现除零的错误。参考存储过程:DC_ProjCost_SelByProjID。

在SQL Server中凡出现除法运算的,都会出现除零的错误。

参考存储过程:DC_ProjCost_SelByProjID。(注:这个是我自己查找方面,就不在这里放这个UP了)

复制下面的预防放在存储过程中,即可避免出现此错误。

--下面2行用于破解除零错误,禁止出现以零除的错误中断,而让其为 null。

SET ANSI_WARNINGS off

SET ARITHABORT off 

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn