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

  • Home
  • SEARCH
  • 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 35543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:15:08+00:00 2026-05-10T14:15:08+00:00

This is a question I asked on another forum which received some decent answers,

  • 0

This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight.

The problem is that you have one of your pages in a web application timing out when it gets to a stored procedure call, so you use Sql Profiler, or your application trace logs, to find the query and you paste it into management studio to figure our why it’s running slow. But you run it from there and it just blazes along, returning in less than a second each time.

My particular case was using ASP.NET 2.0 and Sql Server 2005, but I think the problem could apply to any RDBMS system.

  • 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. 2026-05-10T14:15:09+00:00Added an answer on May 10, 2026 at 2:15 pm

    This is what I’ve learned so far from my research.

    .NET sends in connection settings that are not the same as what you get when you log in to management studio. Here is what you see if you sniff the connection with Sql Profiler:

    -- network protocol: TCP/IP   set quoted_identifier off   set arithabort off   set numeric_roundabort off   set ansi_warnings on   set ansi_padding on   set ansi_nulls off   set concat_null_yields_null on   set cursor_close_on_commit off   set implicit_transactions off   set language us_english   set dateformat mdy   set datefirst 7   set transaction isolation level read committed   

    I am now pasting those setting in above every query that I run when logged in to sql server, to make sure the settings are the same.

    For this case, I tried each setting individually, after disconnecting and reconnecting, and found that changing arithabort from off to on reduced the problem query from 90 seconds to 1 second.

    The most probable explanation is related to parameter sniffing, which is a technique Sql Server uses to pick what it thinks is the most effective query plan. When you change one of the connection settings, the query optimizer might choose a different plan, and in this case, it apparently chose a bad one.

    But I’m not totally convinced of this. I have tried comparing the actual query plans after changing this setting and I have yet to see the diff show any changes.

    Is there something else about the arithabort setting that might cause a query to run slowly in some cases?

    The solution seemed simple: Just put set arithabort on into the top of the stored procedure. But this could lead to the opposite problem: change the query parameters and suddenly it runs faster with ‘off’ than ‘on’.

    For the time being I am running the procedure ‘with recompile’ to make sure the plan gets regenerated each time. It’s Ok for this particular report, since it takes maybe a second to recompile, and this isn’t too noticeable on a report that takes 1-10 seconds to return (it’s a monster).

    But it’s not an option for other queries that run much more frequently and need to return as quickly as possible, in just a few milliseconds.

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

Sidebar

Related Questions

i have already asked this question on asp.net forum, could not find any satisfactory
Based on this question I asked earlier on setting up cookies in Perl ,
I recenty asked a question about parallel programming algorithms which was closed quite fast
From this previously asked question , I have noticed that when I move a
I've asked here a ton of questions about WSAAsyncSelect and NET.Few months ago I
I was answering a question a few minutes ago and it raised to me
I have a large .NET web application. The system has projects for different intentions
Can i do the following in a silverlight page/app? (Note: the silverlight app will
Recently I have been studying recursion; how to write it, analyze it, etc. I

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.