By default, the SQL ARITHABORT connection option is disabled for OLEDB connections, which I assume Linq To SQL uses. However, I need it to be turned on. The reason is because my database contains some indexed views, and any insert / update / delete operations with tables that are part of the indexed view are not performed if there is no ARITHABORT ON in the connection. Even the choice due to the indexed view itself fails if you use the WITH (NOEXPAND) hint (which you should use in SQL Standard Edition to take advantage of the performance of the indexed view).
Is there somewhere in the data context that I can specify I want to enable this option? Or somewhere in the code can I do this ??
I did a clumsy workaround, but I don't like it .... I need to create a stored procedure for each select / insert / update / delete operation, and in this proc, first run SET ARITHABORT ON, then exec another proc that contains the actual select / insert / update / delete. In other words, the first proc is just a wrapper for the second. Don't just set SET ARITHABORT ON over the select / insert / update / delete code.
source
share