今天遇到了这种问题,一个存储过程,运用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的写法