Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timeout Expired

Status
Not open for further replies.

cags

Programmer
May 24, 2001
3
GB
hi
I am trying to run a long stored procedure(approx 2 minutes) from an asp page which should then go on to display the returning values (about 4400 rows worth)...when I run it and capture the error, I get 2147217871 - timeout expired.

Anyone know how to fix this?

 
Change the Connection Pooling retry time to a higher number in the ODBC settings in the control panel.
 

Have you optimized the stored procedure? Do the tables involved have indexes? Are you using cursors in the SP? If so, could the cursors be eliminated in favor SQL operations on relations? I'd make sure the procedure worked well before increasing timeout values.

Users hate stored procedures that take 2 minutes to execute and return data to an ASP page. SQL is capable of handling tens of thousands of records in a few seconds if queries are optimized and proper indexes are installed. Terry L. Broadbent
Life would be easier if I had the source code. -Anonymous
 
The default timeout for a query to execute is 30 seconds in most OLE DB providers. You can change it in one of the following two ways:

if you are running your query using connection.execute method then before you start the query set the command timeout to a higher value using:
connection.commandtimeout = 120 'seconds

If you use command object for your query then do

command.commandtimeout = 120 'seconds

Setting commandtimeout to 0 makes it infinite.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top