Solved

Server.Timeout change not working

Posted on 2002-05-24
5
200 Views
Last Modified: 2011-10-03
I've written a SQL 2000 stored procedure that goes into my database, checks to see whether or not indexes exist for my data, and if not, continues on and adds them.

However, I have about 650,000 records that need to be processed, holding up the script for a long time.

I've tried to use Server.Timeout to change the setting, but unfortunately that doesn't seem to be working.


My code is as follows:

<% option explicit
Response.Buffer = TRUE
Server.ScriptTimeout = 3600
'response.write Server.ScriptTimeout

b = c.Execute(index)  'index = "Execute sp_...."

%>

The error I keep getting is:

Microsoft OLE DB Provider for SQL Server error '80040e31'

Timeout expired

/web/list.asp, line 81


Line 81 is the Execute Line.


Any thoughts would be greatly appreciated.


-JS


0
Comment
Question by:jsolo
  • 3
  • 2
5 Comments
 

Author Comment

by:jsolo
ID: 7032009
Forgot to mention that the timeout occurs after the default time, about 90 seconds.
0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 100 total points
ID: 7032057
You have to change the Connection.Timeout and Command.Timeout values of the Connection Object and not the Server.Timeout property alone.

What you are experiencing is an ADO Problem and not an ASP problem.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7032061
secondly, you shouldn't really be using ASP for this kind of work. It wasn't designed for this.

Checking 650,000 rows with ASP is terrible. Write A VB Programme, or better still a C# or VB.NET programme dedicated to do this.
0
 

Author Comment

by:jsolo
ID: 7032114
Thanks for the help.  Could you elaborate more on the other possibilies?  

The project I'm working must be on the web, so how could I change what I'm doing to speed up the process?

Thanks again.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7032130
You are better off doing this:
1. Have a web page that accepts administrative commands,
submitting this to the database as a single record per action.

2. Inside Microsoft SQL Server, create a scheduled task that checks on specified intervals for the particular value. Based on the field being say 1 (a bit type field), it fires off the action based on the fieldname. After the work is done, reset the bit to 0.

This is best performed solely inside Microsoft SQL Server and not via ASP.

0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question