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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:41:06+00:00 2026-06-14T08:41:06+00:00

We have a program that connects to our DB and run some Stored Procedures

  • 0

We have a program that connects to our DB and run some Stored Procedures to get some data.

The database is a SQL Server 2008 and the program runs locally. The connection is via TCP/IP, but shared memory is enabled. And the timeout of the connection string is set to 45 sec.

When we run them through SQL Server Management Studio, it takes 0-5 seconds to run.
When we run it through code, it randomly times out.

To make some test, we increased the timeout from 45sec to few minutes. And also to discard any blocking issue we checked that the Stored Procedures only “selects” data (with no insert or update statement). And we have tried several table modifiers for the select statements like: nolock, readpast, …

Also I checked sp_who2 and dbcc opentran() and nothing is blocked… and the SPID of the .Net is running command .... For more details while the .Net is waiting a DB answer, through SQL Server Management Studio I can run the same statement (Stored Procedure or Select) without problems.

Any suggestion of what is happening?

  • 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-06-14T08:41:07+00:00Added an answer on June 14, 2026 at 8:41 am

    The connection string timeout only influences the login timeout. You seems to hit a command timeout, and that can be changed only by modifying the CommandTimeout. The default value is 30 seconds, the recommended value is 0 (infinite timeout).

    As for why your procedure hits random slow execution, I recommend to start by reading Slow in the Application, Fast in SSMS? Understanding Performance Mysteries

    BTW, your query is likely not blocked. It executes a different plan that simply takes that long to execute. Checking for last_wait_type in sys.dm_exec_requests will likely reveal IO waits (PAGEIOLATCH, after to chasse any red-herring CXPACKET down the sys.dm_os_workers join…). But there is no point repeating the far more comprehensive and excellent article by Erland Sommarskog I originally linked.

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

Sidebar

Related Questions

I have a c# program that connects to SQL server 2008 and works with
I'm working on a VB6 program that connects to a SQL Server 2008 R2
I have a java program that connects to a MySql database and it's working
I have a program that needs to connect to a server to gather some
I have a program that connects to an Oracle database and performs operations on
I have a program in C++ using winsock that connects to a server, the
We have a C# application that connects to a FTP server, downloads some files,
I have a server program that connects to another program via a given socket,
I have a Java program that connects to a webserver using SSL/TLS, and sends
I have a client program written in .NET 2.0, that connects to the web

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.