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 3595460
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:51:18+00:00 2026-05-18T19:51:18+00:00

The problem is I have a stored procedure that runs consistently in Sql Server

  • 0

The problem is I have a stored procedure that runs consistently in Sql Server Management Server with a time of 2 seconds but when calling that same stored procedure from code it times out.

When it runs correctly from SSMS it should return about 30 rows.

I’ve tried a few different ways to call the procedure from code but every time the same result. This just recently started happening, yesterday it was working fine.

The preferred method for calling the procedure for us is using Linq2Sql which gives the following error message:

Timeout expired. The timeout period
elapsed prior to completion of the
operation or the server is not
responding. Description: An unhandled
exception occurred during the
execution of the current web request.
Please review the stack trace for more
information about the error and where
it originated in the code.

Exception Details:
System.Data.SqlClient.SqlException:
Timeout expired. The timeout period
elapsed prior to completion of the
operation or the server is not
responding.

Source Error:

Line 16:         public IMultipleResults GetTournamentRatingNonComplaintData([global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "DateTime")] System.Nullable<System.DateTime> startdate, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "DateTime")] System.Nullable<System.DateTime> enddate, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Int")] System.Nullable<int> officialSportID, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Char(1)")] System.Nullable<char> gender, [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Int")] System.Nullable<int> level)
Line 17:         {
Line 18:             IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), startdate, enddate, officialSportID, gender, level);
Line 19:             return ((IMultipleResults)(result.ReturnValue));
Line 20:         }

Does anyone know what the differences are between running it in SSMS and through code? What can be done to troubleshoot this issue?

  • 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-18T19:51:18+00:00Added an answer on May 18, 2026 at 7:51 pm

    Your connection from SQL Management studio may be configured differently from the connection string you’re using from .NET.

    For example, see the options that are set by default in SQL Management Studio Tools/Options/Query Execution/SQL Server/Advanced.

    I would suspect some setting that is different between the two environments is causing your problem. To debug you should try to configure SQL Server Management Studio to use the same configuration as your .NET connection string before running your SP.

    Or alternatively, add SET statements to your .NET query to configure all the options you see configured in Management Studio.

    It’s not always easy to find the setting that’s different – in my experience a common cause is different ANSI settings.

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

Sidebar

Related Questions

We have the following simple Stored Procedure that runs as an overnight SQL server
I have a script that runs a stored procedure in my SQL server database,
I have a stored procedure in SQL Server 2008 that will insert a record
I'm trying to build a VBA form that runs a SQL Server stored procedure
I have a problem with an application which uses the same stored procedure over
I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem -
I have a stored procedure in a MS-SQL 2005 database that: Creates two temp
Let's say that I have a form which runs a stored procedure. This stored
I have a stored procedure that runs to update gaming points for user balances.
Problem: I have two spreadsheets that each serve different purposes but contain one particular

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.