存储过程执行另一个存储过程

时间:2022-09-20 23:04:58

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.

当存储过程内部有查询来执行另一个存储过程时,调用存储过程是否会停止其他存储过程已完成执行?我想我是想直接思考它是否像同步和异步调用一样。

2 个解决方案

#1


6  

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.

是的,他们是同步的。他们必须是。如果存储过程A期望存储过程B的结果,则它必须等待存储过程B完成。如果它们是自动异步的,那么影响将是巨大的。

For a follow up. Here is how to make stored procedures asynchronous in MSSQL Server (well as asynchronous as possible):

跟进。以下是如何在MSSQL Server中使存储过程异步(尽可能异步):

Asynchronous Stored Procedure Calls

异步存储过程调用

#2


3  

Yes, it's synchronous

是的,这是同步的

#1


6  

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.

是的,他们是同步的。他们必须是。如果存储过程A期望存储过程B的结果,则它必须等待存储过程B完成。如果它们是自动异步的,那么影响将是巨大的。

For a follow up. Here is how to make stored procedures asynchronous in MSSQL Server (well as asynchronous as possible):

跟进。以下是如何在MSSQL Server中使存储过程异步(尽可能异步):

Asynchronous Stored Procedure Calls

异步存储过程调用

#2


3  

Yes, it's synchronous

是的,这是同步的