ASP timeout on SQL stored procedure

Results 1 to 2 of 2

Thread: ASP timeout on SQL stored procedure

  1. #1
    Krista Guest

    Default ASP timeout on SQL stored procedure

    On winnt platform, I am connecting to SQL server using ASP code. I am encountering a problem, when I execute a stored procedure that takes SQL longer than 30 secs to return something to the ASP. If the ASP doesn&#039t get anything within 30 secs, it kills the stored proc, and doesn&#039t return an error. Does anyone know how to solve this problem???

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: ASP timeout on SQL stored procedure

    First off, what on earth are you doing that requires a stored procedure to take 30+ seconds??!!??<BR><BR>To answer your question, you can set the CommandTimeout property of the Connection object.<BR><BR>So, if you are doing something like:<BR><BR>Dim objConn<BR>objConn.Open "DSN=pubs"<BR>objConn.Execute("sp_LongRunningSP")< BR><BR>Just add the line:<BR>objConn.CommandTimeout = 60 &#039in seconds, here so however long you need<BR><BR>before objConn.Open.<BR><BR>Good luck and happy programming! You may want to dedicate some cycles to come up with a way to reduce the procedure execution time!

Posting Permissions

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