Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

SQL Timeout issue

I have a stored procedure that I call from a vb.net application. It is an involved procedure that will take a few minutes to complete it. Whenever it runs after a few minutes I get an timeout error. I have adjusted the connect time in my connection string and that does not seem to help. Any ideas?
  • 2
2 Solutions
Use the query wait option to specify the time in seconds (from 0 through 2147483647) that a query waits for resources before timing out.

query wait is an advanced SQL option. If you are using the sp_configure system stored procedure to change the setting, you can change query wait only when show advanced options is set to 1. The setting takes effect immediately (without a server stop and restart).
Also, if you're using a SqlCommand object to execute the stored procedure, set the Commandtimeout property of that object to a suitable amount of time.
mwhodgesAuthor Commented:
I have tried to change the Connect Timeout=1000 in the sql connection to allow for a longer time witout any help. Is there a way I can manipulate the the timeout without making any permenant changes to the server?
mwhodgesAuthor Commented:
I figured it out. I appreciate all your help. Here is the solution that I came up with
   cmdselect.CommandTimeout = 1000.
Thanks for everything.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now