How can I run a slow proc asychronously from without another stored procedure?
I have a stored procedure that does a small transaction and afterwards sends a confirmation e-mail.
Creating and sending the e-mail takes are long time and blocks my main procedure which could already return. The creation and sending of the e-mail could be done in the background and is of no importance to the user.
Is there a way to as开发者_Go百科ynchronously run a stored procedure? Something along the lines of "exec_async proc_name".
Not really - but the easiest way to do this is to dump the data you need for the email into a separate table, and then have a separate scheduled job that picks it up from that table and does whatever processing you need to do..
精彩评论