July 29th, 2004, 03:25 PM
SQL Server error '80040e31' Timeout Expired
So I have been reading quite a few different threads on this error, but so far none of the solutions have completely
worked for me. Let me explain my situation:
I have a query that I've built within my ASP page that basically Selects approx. 1,000,000 rows of data in 3 different ways.
1. The 1st Select returns the data to the screen in approx. 60-70 sec's. This works fine.
2. The 2nd Select writes the same data set to a file in approx. the same time. This also works.
3. The 3rd Select actually calls 2 Stored Procedures and also writes to a file. If I select under 300,000 rows, the 3rd Select works fine too. If I try selecting the 1,000,000 rows, after about 90 seconds I get the error:
Microsoft OLE DB Provider for SQL Servererror '80040e31'
/POS_Zip/POS_Extract_Download.asp, line 234
I have tried setting the conn.ConnectionTimeout = 0 and the conn.CommandTimeout = 0. That doesn't help.
I have tried setting the conn.ConnectionTimeout = 6000 and the conn.CommandTimeout = 6000. That doesn't help.
I have also tried setting the Server.ScriptTimeOut = 6000. That doesn't help.
I'm pretty certain it has something to do with the Stored Procedures, but I did not write those, so I am not positive. Also, if I run
this within Query Analyzer it seems to work fine, taking approx. 65 sec's.
I can provide specifics if needed, but I believe it's just a setting that I haven't figured out yet since I can get the queries to run the first two ways. Any ideas or help would be much appreciated!! I need to have this resolved very quickly and I'm running out of ideas. Thanks in advance.