Yesterday has been tangled in the implementation of the problem of the stored procedure exception, and later wrote a demo test, and went to the Internet to find information, finally solved the problem.
When you try to update a table that is referenced by an indexed view on SQL Server, you may be recycled to the following error
INSERT failed because the settings for the following set options are incorrect: ' ARITHABORT '
When you create or manipulate an index on a computed column or indexed view, the SET ansi_nulls must also be on. If SET ansi_nulls is OFF, the CREATE, UPDATE, INSERT, and DELETE statements on the indexed table on the computed column or indexed view will fail. SQL Server will return an error listing all SET options that violate the required values. Also, when the SELECT statement is executed, if SET ansi_nulls is OFF, SQL Server ignores the index values on the computed column or view and resolves the selection as if there were no such indexes on the table or view.
Solution:
1. You must set ARITHABORT on before TSQL, the code is as follows
Set ARITHABORT on
GO
INSERT into TA.
2. In ADO, you can write in this way (C # code)
Myconnection.execute ("SET ARITHABORT on");
If you're feeling a lot of trouble or can't change for some reason, you can try modifying the SQL Server server option
3.exec sp_dboption ' Yourdb ', ' ARITHABORT ', ' true '
It's OK
4.ALTER DATABASE Yourdb
SET ARITHABORT on
Issues with executing stored procedure exceptions