Results 1 to 6 of 6

Thread: Timeout error -2146232060 SQL

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Timeout error -2146232060 SQL

    I am having a timeout issue. My application call a T-SQL stored procedure to delete several hundred thousand records after a process has been completed.
    650,000 not unusual.

    The code for the T-SQL is a no-brainer

    DELETE FROM CardDetail
    WHERE BCDGAME=@GameNbr and BCDGameDate = @Date_Id and BCDGameCntrl = @Seq_Id.

    I have a try/catch to trap this and get this error

    {"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."}

    None of the records have been deleted. How do I get around this??

    Thanks

    gollnick
    William E Gollnick

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Timeout error -2146232060 SQL

    Have you tried settinc the connection timeout value? Can you try and batch the delete in an SP?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Timeout error -2146232060 SQL

    By default the command timeout is only 30 seconds... so if it is going to take longer than that, you need to change the CommandTimeout value to something larger that will allow the command to finish executing.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: Timeout error -2146232060 SQL

    It is in a stored procedure already. I am new to SQL.management. How do I change the CommandTimeout value for this stored procedure? Or is it for the entire database and all the talbles within it?

    Thanks

    gollnick
    William E Gollnick

  5. #5
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Timeout error -2146232060 SQL

    On your command object (if doing this from a font end). If you are doing this from SSMS let us know.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: Timeout error -2146232060 SQL

    Thanks all.... went to my code front end and changed the timeout value on the command string into the sp... duhhhhhhh....
    Again .. thanks for the direction

    gollnick
    William E Gollnick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width