|
-
Jan 20th, 2003, 09:05 AM
#1
Thread Starter
Junior Member
Must be a way....
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
-
Jan 20th, 2003, 09:20 AM
#2
New Member
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
-
Jan 20th, 2003, 09:55 AM
#3
Registered User
There is also a Query Timeout value inside SQL Server that can be editted through Enterprise Manager......
-
Jan 20th, 2003, 10:06 AM
#4
Thread Starter
Junior Member
Thx all.
Can you please tell me how to change the querytimeout thru Enterprise Manager!?
L
-
Jan 20th, 2003, 10:11 AM
#5
Thread Starter
Junior Member
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??
-
Jan 20th, 2003, 11:41 AM
#6
Lively Member
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.
-
Jan 20th, 2003, 12:09 PM
#7
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.
-
Jan 20th, 2003, 12:14 PM
#8
Addicted Member
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?
Wydok
"It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years."
-John Von Neumann ca. 1949
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|