Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Asynchronous Logic

Author  Topic 

RyanAustin
Yak Posting Veteran

50 Posts

Posted - 2009-12-09 : 16:20:19
Does anyone have an idea of how to run a stored procedure, that calls 5 seperate insert statements, asynchronously?

When we run the procedure and it runs all the statements sequentially it can take anywhere from 1.5 hours to 3 hours. I would like to be able to run all 5 of those statements in parallel.

The statements themselves are simple trunc, insert into statements. Nothing fancy.

Thanks,

Ryan

X002548
Not Just a Number

15586 Posts

Posted - 2009-12-09 : 16:22:02
it'd be easier for us if you post the sproc



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-12-09 : 17:29:37
Have a look at this: http://www.databasejournal.com/features/mssql/article.php/3427581/Submitting-A-Stored-Procedure-Asynchronously.htm

Though I'd actually use Service Broker to accomplish this most likely.

By the way, running them asynchronously may not significantly spped it up, depending on what they do, and system resource utilization.

Also, you could make 5 jobs and schedule them to run at the same time...
Go to Top of Page
   

- Advertisement -