今天遇到了这种问题,一个存储过程,运用Sqlserver2005的新功能 xquery,在查询分析器里没错,可以取得结果,但是用asp.net调用却出现这样的错误。SELECT 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.
后查询相关资料得到结果,The SET options were declared before the CREATE stored proc. The SP was called from a batch job & the batch job always overrides any set options.
所以需要把 set ARITHABORT ON 放在create后即可
也可在 Myconnection.Exceute "set ARITHABORT ON "解决,不过这是VB的写法
本文解决了ASP.NET调用SQL Server 2005中使用XQuery的存储过程时出现的ARITHABORT设置错误。通过调整SET选项的位置或直接在连接前设置ARITHABORT ON来解决此问题。

1966

被折叠的 条评论
为什么被折叠?



