Click to See Complete Forum and Search --> : SQL Timeout Errors


DaddyGweedo
April 7th, 2003, 02:52 PM
I've posted about this before, but everytime I think I have the answer, it comes up and bites me again.

I am having alot of issues with SQL calls to a Microsoft SQL Server database. I'm running some, in my opinion , pretty complex SQL queries, using som Case statements and doing some inline calculations. They are pointing to a view stored in the database that does the joins for me.

Here is my issue. I set the database connection time out to well more than necessary to complete the query. I also set my command timeout for 240 seconds. If I run the query in The SQL Query Analyzer it takes about 1 minute 13 seconds to complete, yet it timesout in my VB .Net code.

Any suggestions?

DG.

ITGURU
April 16th, 2003, 12:23 AM
Hello DaddyGweedo,

There are two ways for setting Query Execution time out period:

1. Either set Command timeout period to some value which you can think suitable for your Query to Execute and if you did not know how much time your query will take then set its value to 0(zero) e.g.

objCommand.CommandTimeout = 0

2. And Set Query Time out period in connection tab of SQL Server properties window, which you can option by right clicking on SQL Server name and select Properties in Context Menu window.
In this also if you want that timeout never occurs then set its value to 0(zero).

Hope this will solve your problem.