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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:36:22+00:00 2026-05-27T04:36:22+00:00

So we have a process that runs and it calls our DB to get

  • 0

So we have a process that runs and it calls our DB to get some data. When we run the proc that gets called through SQL Server Management Studio, it takes anywhere from 6 minutes to 15 minutes to run, but does complete. When we run it through code, it always times out. My guess is that the code’s expected timeout range gets exceeded, but the proc would actually still run if it could, since it does directly through the Management Studio interface.

Here’s the exception details:

InnerException: System.Data.SqlClient.SqlException
       Message=Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
       Source=.Net SqlClient Data Provider
       ErrorCode=-2146232060
       Class=11
       LineNumber=0
       Number=-2
       Procedure=""
       Server=KSQCOREDBINT
       State=0

And here’s the stack trace if it helps at all:

StackTrace:
            at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
            at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
            at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
            at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
            at System.Data.SqlClient.SqlDataReader.get_MetaData()
            at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
            at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
            at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
            at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
            at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
            at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
            at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
            at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
            at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
            at Chatham.Panda.DataAccessLayer.CoreDataContext.sp_calc_schedule_rates_retrieve(Nullable`1 se_sched_id) in c:\TeamCity\BuildAgent02\work\36e300184c20475\Chatham.Panda.DataAccessLayer\Core.designer.cs:line 2306
            at Chatham.Panda.EndOfDay.EodDataAccess.<>c__DisplayClass15.<SpCalcScheduleRatesRetrieve>b__14(CoreDataManager coreDataManager) in C:\svn\K2\trunk\panda\ScheduleBuilderService\Chatham.Panda.EndOfDay\EodDataAccess.cs:line 134
            at Chatham.Panda.EndOfDay.EodDataAccess.RunStoredProc[T](Func`2 storedProcDelegate, String storedProcName) in C:\svn\K2\trunk\panda\ScheduleBuilderService\Chatham.Panda.EndOfDay\EodDataAccess.cs:line 21

Anyway we can increase the allotted timeout range or something? We’re continuously working on improving the stored proc, but that’s up to the DB team. Just trying to see if I can do something on my end.

Thanks.

  • 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-27T04:36:22+00:00Added an answer on May 27, 2026 at 4:36 am

    SQL commands time out because the query you’re using takes longer than that to execute. Execute it in Query Analyzer or Management Studio, with a representative amount of data in the database, and look at the execution plan to find out what’s slow.

    If something is taking a large percentage of the time and is described as a ‘table scan’ or ‘clustered index scan’, look at whether you can create an index that would turn that operation into a key lookup (an index seek or clustered index seek).

    Troubleshooting Timeout SqlExceptions

    you can set the CommandTimeout on a SqlCommand:

    objCmd.CommandTimeout = 600
    

    SqlConnection.ConnectionTimeout is read-only property

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

Sidebar

Related Questions

We have a HPC node that runs some of our tasks in it. I
We have a large process in our application that runs once a month. This
I have a process that currently runs in a Delphi application that I wrote
I have a build process that does the following: Runs TLBIMP on a number
We have a process that needs to run every two hours. It's a process
I have a process that imports a lot of data (950k rows) using inserts
I have a shell script that calls a java jar file and runs an
So I have a python script that runs a loop in which it calls
We have a process that runs a few times a day (via a Windows
I am looking to optimize a process that runs continually and makes frequent calls

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.