存储过程执行另一个存储过程 [英] Stored procedure executing another stored procedure
问题描述
当一个存储过程内部有查询要执行另一个存储过程时,调用存储过程是否停止其他存储过程已完成执行?我想我正试图弄清楚它是否像同步和异步调用.
When a Stored Procedure has a query inside to execute another Stored Procedure, does the calling Stored Procedure stop other Stored Procedure has finished executing? I guess I'm trying to get straight in my head whether it's like synchronous and asynchronous calls.
推荐答案
是的,它们是同步的.他们必须是.如果存储过程 A 期望来自存储过程 B 的结果,则它必须等待存储过程 B 完成.如果它们是自动异步的,影响将是巨大的.
Yes they are synchronous. They would have to be. If stored procedure A is expecting a result from stored procedure B, then it would have to wait for Stored Procedure B to finish. The implications would be huge if they were automatically asynchronous.
进行跟进.以下是如何在 MSSQL Server 中使存储过程异步(尽可能异步):
For a follow up. Here is how to make stored procedures asynchronous in MSSQL Server (well as asynchronous as possible):
这篇关于存储过程执行另一个存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!