Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 27th, 2006, 07:52 AM
Registered User
 
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error:-2147217871 Timeout expired

Hi everyone,

  I have a application in which some processing of files is done. When the processing is carried, the same is interrupted by the error

   "Error:-2147217871 Timeout Expired"
My application is connected to the database on sql server 2000.
Please some one help me out with this. This is a client side exception and you people can imagine my position right now!!

 
Old June 27th, 2006, 03:40 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Set CommandTimeout to a larger value.

 
Old June 27th, 2006, 11:45 PM
Registered User
 
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you be more specific on this please?

 
Old June 28th, 2006, 01:19 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you are using ADO to connect to SQL Server, there is a property named CommandTimeout. Default is, I think, 30 seconds. Set this property to 300 for 5 minutes.

 
Old June 30th, 2006, 04:48 AM
Registered User
 
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Peso.It has been very helpful for me!!:)

 
Old June 30th, 2006, 05:08 AM
Registered User
 
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also could you tell me where should i make these settings??
Please??

 
Old June 30th, 2006, 06:12 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When you create your command object, set the obj.CommandTimeout to 300

Obj.CommantTimeOut = 300

 
Old November 22nd, 2006, 08:43 AM
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI
I have the following code for calling a Stored procedure, which is calculation intensive. Although I have increased all possible timeouts, it still gives me Timeout Expired -214721787 error

************************************************** ***********
    Set RS = New ADODB.Recordset
    Set cmd = New ADODB.Command

    'Init the ADO objects
    cmd.ActiveConnection = gsConnectionString
    cmd.CommandTimeout = 0
    cmd.CommandText = strSP
    cmd.CommandType = adCmdStoredProc

    'Create the stored proc parameters
    CreateParams cmd, varParams

    ' Execute the query for readonly
    RS.CursorLocation = adUseClient
    RS.CacheSize = 500
    RS.Open cmd, , adOpenForwardOnly, adLockReadOnly

    ' Disconnect the recordset
    Set cmd.ActiveConnection = Nothing
    Set cmd = Nothing
    Set RS.ActiveConnection = Nothing

    ' Return the disconnected recordset
    Set gdbrsRunSPReturnRS = RS
    Set RS = Nothing

************************************************** ***********

what can be done to resolve the issue?

 
Old November 22nd, 2006, 10:33 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

You'll also get the timeout message if someone already has a lock on the SQL objects in the form of uncommitted updates or inserts. I also think that increasing the timeout to more than 30 seconds is just a band-aid for a much larger more serious problem. It could be transaction leaks (someone forgot to commit or rollback), poorly formed SQL, a bad database design, missing indexes, etc, etc. I'd start looking for what the actual cause of the timeout is because 30 seconds is more than anyone should have to wait in an app...

--Jeff Moden
 
Old November 22nd, 2006, 10:35 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Quote:
quote:Originally posted by architsureka
 HI
I have the following code for calling a Stored procedure, which is calculation intensive. Although I have increased all possible timeouts, it still gives me Timeout Expired -214721787 error...
Post the proc so folks can take a look at it...

--Jeff Moden





Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Timeout Expired error smnel ASP.NET 2.0 Basics 0 May 7th, 2008 06:58 AM
Timeout Expired Error dhara_adh SQL Server 2000 4 December 22nd, 2006 04:18 PM
Timeout Expired Error nikotromus SQL Server 2000 16 December 5th, 2006 03:54 PM
Timeout Expired Error dbalachandar SQL Server 2000 3 July 28th, 2006 01:35 AM
Timeout Expired Error vinod_pawar1 SQL Server 2000 5 July 17th, 2004 09:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.