I am using ASP.NET with MVC3 with a SQL server database. From time to time, one of our stored procedures become incredibly slow when called by the web platform, but stay as fast when called directly in SSMS.
The solution to this problem is to write "SET ARITHABORT ON" at the beginning of the stored procedure, which magically works.
However, I want this to stop since I don't what is causing procedures to randomly start being incredibly slow on the web and causing timeouts.
Is there a way to resolve the problem definitely?
Thanks in advance, Eric
"Multiple Active Result Sets = true"
in your connection string. This is a common issue when using EF. If you aren't using Lazy Loading, then you can probably get rid of the "MARS = true" in the connection string if it is currently there.