在VB.NET2003中执行商店程序的问题 [英] pROBLEM IN EXECUTING STORE PROCEDURE IN VB.NET2003

查看:83
本文介绍了在VB.NET2003中执行商店程序的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,我已经在表中使用了一个计算字段,并且当我从sql server客户端执行t hat过程时,该表在我的存储过程中使用它工作正常当我尝试要在vb.net代码中使用该存储过程,它会抛出以下错误: - UPDATE失败,因为以下SET选项具有不正确的设置:'ARITHABORT'。验证SET选项是否正确用于索引视图和/或索引计算列和/或查询通知和/或xml数据类型方法。



请帮助我在商店程序的开头尝试SET ARITHABORT on但没有积极发生。

Dear All, I have used a computed field in a table and that table is used in my store procedure now when i make execute that procedure from sql server client it works fine and WHEN i try to used that store procedure in vb.net code then it throws the following error :- "UPDATE failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods."

Please Help i tried "SET ARITHABORT on" in the beginning of the store procedure but nothing positive happened.

推荐答案

Quote:

在溢出或除法时终止查询在查询执行期间发生-by-zero错误。



如果SET ARITHABORT为ON ,这些错误条件会导致查询或批处理终止。如果事务中发生错误,则回滚事务。如果SET ARITHABORT为OFF 并且出现其中一个错误,则会显示一条警告消息,并将NULL分配给算术运算的结果

注意如果既未设置SET ARITHABORT也未设置SET ARITHIGNORE,则Microsoft®SQLServer™返回NULL并在执行查询后返回警告消息。

当INSERT,DELETE或UPDATE语句遇到算术时在SET ARITHABORT为OFF时,表达式评估期间出现错误(溢出,被零除或域错误),SQL Server会插入或更新NULL值。如果目标列不可为空,则插入或更新操作将失败,并且用户收到错误。

如果SET ARITHABORT或SET ARITHIGNORE为OFF且SET ANSI_WARNINGS为ON,则SQL Server仍会返回错误遇到被零除或溢出错误时的消息。

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

If SET ARITHABORT is ON, these error conditions cause the query or batch to terminate. If the errors occur in a transaction, the transaction is rolled back. If SET ARITHABORT is OFF and one of these errors occurs, a warning message is displayed, and NULL is assigned to the result of the arithmetic operation.
Note If neither SET ARITHABORT nor SET ARITHIGNORE is set, Microsoft® SQL Server™ returns NULL and returns a warning message after the query is executed.
When an INSERT, DELETE or UPDATE statement encounters an arithmetic error (overflow, divide-by-zero, or a domain error) during expression evaluation when SET ARITHABORT is OFF, 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 either SET ARITHABORT or SET ARITHIGNORE is OFF and SET ANSI_WARNINGS is ON, SQL Server still returns an error message when encountering divide-by-zero or overflow errors.





链接: ARITHABORT - MSDN [ ^ ]


问题是在您的计算列中。计算失败,除以零错误或推翻。查看此链接



http:// msdn .microsoft.com / zh-cn / library / ms190306.aspx [ ^ ]
The problem is in your computed column. The computation is failing with divide by zero error or overthrow. Check this link

http://msdn.microsoft.com/en-us/library/ms190306.aspx[^]


这篇关于在VB.NET2003中执行商店程序的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆