Execute a stored procedure from ASP page, but don't wait for it to complete?

R

Richard Morey

Hi..

I have written a stored procedure that take 5 - 8 minutes to fully execute..
I wrote this routine as a stored procedure because I started to create all
the functionality via ASP but I kept getting time out errors on my ASP page.
The problem is that when I call the stored procedure from the ASP page the
server waits for the procedure to complete before returning the ASP page..
Is there any way to avoid this? I would like the user to be able to trigger
the stored procedure and have the page returned right away..

Thanks,

Rich
 
B

Bob Barrows

Richard said:
Hi..

I have written a stored procedure that take 5 - 8 minutes to fully
execute.. I wrote this routine as a stored procedure because I
started to create all the functionality via ASP but I kept getting
time out errors on my ASP page. The problem is that when I call the
stored procedure from the ASP page the server waits for the procedure
to complete before returning the ASP page.. Is there any way to avoid
this? I would like the user to be able to trigger the stored
procedure and have the page returned right away..
Use SQL Agent to schedule the procedure to run as a job. Disable the job.
This is well-documented in Books Online

Then call the sp_start_job system stored procedure from ASP to start the
job. The job will run asynchronously.

The login you are using to connect from ASP will need to be granted
permissions to run that system stored procedure.

HTH,
Bob Barrows
 
C

Chris

have you tried the command objects adAsyncExecute parameter on execute

objCmd.Execute, , adAsyncExecut

I don't know if it works, but it is a parameter option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,133
Latest member
MDACVReview
Top