to change the timeout setting, but no-one has been able to tell me how....... YET!!!!
Any ideas.....
This is the error
Code:
Microsoft OLE DB Provider for SQL Server error '80040e31'
Timeout expired
Printable View
to change the timeout setting, but no-one has been able to tell me how....... YET!!!!
Any ideas.....
This is the error
Code:
Microsoft OLE DB Provider for SQL Server error '80040e31'
Timeout expired
Do you use ADO ?
dim oConn as new ADODB.Connection
oConn.CommandTimeout =60 ' modify this if you want to execute time consuming SQL statements
oConn.Open( strConnString)
oConn.Execute strSQLStatement,,adcmdText
There is also a Query Timeout value inside SQL Server that can be editted through Enterprise Manager......
Thx all.
Can you please tell me how to change the querytimeout thru Enterprise Manager!?
L
No still does not work,
I changed the timeout programatticaly AND using Enterprise Manager, but I still
get the same error!!!! The changes I do does not seem to affect the timeout time
at all. It time's out within about 30seconds.
Any ideas??
Try setting it to "0" It should not time out at all.
oConn.CommandTimeout = 0
If that doesn't work try running your query in the query analizer and see how it works there. There may be something out of place in the query.
As a matter of standard, we set all of our Timeouts to 300 (5 minutes) and it seems to be long enough for anything we do. You could try setting it to something outrageous if necessary.
Also instead of setting the CommandTimeout on the Conneciton, set it on the Command object instead.... I know using the Command object adds a little bit more code, but I have found it to be benficial.
Two questions:
1. How long is the SQL Server timeout?
2. If it is longer than a minute or two, why is the SQL statement running so slowly? Could there be a large in clause that could be turned into a join or a subquery? Could your statement be returning a cartisian product instead of the intended data?