开发者

How can I run a slow proc asychronously from without another stored procedure?

开发者 https://www.devze.com 2023-04-01 02:00 出处:网络
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 alread

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..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号