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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run database procedure in background

Status
Not open for further replies.

tcstom

Programmer
Aug 22, 2003
235
GB
I have a SQL Server stored procedure that takes a long time to execute. I want to allow users of a ASP.NET web form to execute this stored procedure but to have it run in the background rather than have the page wait for it to complete. Is there a way to do this?
 
You can start another thread that executes the procedure

____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done
 
Run it asynchronously, but is the sproc running anything that ought to report back to the user?

If so, I'd say you need to rethink your approach.

How long is the sproc taking, and why does it run so slow?
 
It runs slow because it does a hell of a lot! Essentially re-builds a reporting database from live data. Thanks for the feedback guys. Haven't used threads before but looks like now is the time to look into it...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top