Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 875857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:20:32+00:00 2026-05-15T11:20:32+00:00

By default, the SQL connection option ARITHABORT is OFF for OLEDB connections, which I

  • 0

By default, the SQL connection option ARITHABORT is OFF for OLEDB connections, which I assume Linq To SQL is using. However I need it to be ON. The reason is that my DB contains some indexed views, and any insert/update/delete operations against tables that are part of an indexed view fail if the connection does not have ARITHABORT ON. Even selects against the indexed view itself fail if the WITH(NOEXPAND) hint is used (which you have to use in SQL Standard Edition to get the performance benefit of the indexed view).

Is there somewhere in the data context I can specify I want this option ON? Or somewhere in code I can do it??

I have managed a clumsy workaround, but I don’t like it …. I have to create a stored procedure for every select/insert/update/delete operation, and in this proc first run SET ARITHABORT ON, then exec another proc which contains the actual select/insert/update/delete. In other words the first proc is just a wrapper for the second. It doesn’t work to just put SET ARITHABORT ON above the select/insert/update/delete code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:20:33+00:00Added an answer on May 15, 2026 at 11:20 am

    What I ended up doing was writing my own method in my own “helper” class to create the datacontext and using this every time I need a datacontext, e.g.

          Dim conn As New SqlConnection(Config.GetConnectionString("SiteSqlServer"))
          Dim command As New SqlCommand("set arithabort on;", conn)
          command.Connection.Open()
          command.ExecuteNonQuery()
          Dim dc = New SiteDataContext(conn)
    

    The idea here is to use the datacontext constructor that takes a connection as a parameter. I create and open a SqlConnection, run “set arithabort…” on it, and pass it to the DC (credit goes to poster here).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've been using the Windows Workflow default SQL persistence service that handles everything
I have an C# asp.net app using the default Sql MembershipProvider. My web.config has
When I try to change the default collation of a SQL Server instance using
Why is that, with default settings on Sql Server (so transaction isolation level =
I have a script that connects to SQL Server 2005 default instance. But I'm
Suppose I have a PL/SQL stored procedure as follows: PROCEDURE do_something(foo VARCHAR2 DEFAULT NULL)
i want to set the default value in a sql server 2005 datetime field
Is there a way to tell SQL server to use specific default seed value
SQL Server 2005 x64 on Windows Server 2003 x64, with multiple instances (default +
I have a table in SQL Server 2005. alt text http://www.techpint.com/sites/default/files/images/table.JPG I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.