Timeout after 6 hours (SqlCommand object)

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Elyo Ravuna (msdn_at_nebim.com.tr)
Date: 03/01/04


Date: Mon, 1 Mar 2004 07:26:08 -0800

I set SqlCommand.CommandTimeout to 24 hours. However I get a timeout after about 5-6 hours.

  Dim SqlConnection As New SqlConnection("data source=.;Integrated security=sspi")
  Dim SqlCommand As New SqlCommand("waitfor delay '10:0:0'", SqlConnection)
  SqlConnection.Open()
  SqlCommand.CommandTimeout = 3600 * 24
  SqlCommand.ExecuteNonQuery() 'Throws an exception after about 6 hours.

The exact error message is:
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

It seems that something like approximately 6 hours is hard-coded somewhere, or it is the default value of something. How can I run a stored procedure that takes more than 6 hours to complete?

I would be very glad to hear a response from Microsoft.
Sincerely.
Elyo Ravuna



Relevant Pages

  • Re: TimeOut - ThreadAbortException
    ... Thanks for responding, I get nothing in the event log. ... >> to a timeout problem but I'm not sure where to set the timeout expiry. ... >> before the response is sent back you will get a threadAbort exception. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: ASPX pages failing when SQL Server busy
    ... "Error: System.Data.SqlClient.SqlException: Timeout expired. ... server is not responding." ... same server, and same instance). ... (and the big sproc that's running isn't using any explicit transactions). ...
    (microsoft.public.sqlserver.server)
  • Re: ASPX pages failing when SQL Server busy
    ... "Error: System.Data.SqlClient.SqlException: Timeout expired. ... server is not responding." ... same server, and same instance). ... (and the big sproc that's running isn't using any explicit transactions). ...
    (microsoft.public.sqlserver.programming)
  • Re: ASPX pages failing when SQL Server busy
    ... "Error: System.Data.SqlClient.SqlException: Timeout expired. ... server is not responding." ... same server, and same instance). ... (and the big sproc that's running isn't using any explicit transactions). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASPX pages failing when SQL Server busy
    ... "Error: System.Data.SqlClient.SqlException: Timeout expired. ... server is not responding." ... same server, and same instance). ... (and the big sproc that's running isn't using any explicit transactions). ...
    (microsoft.public.dotnet.framework.adonet)