简体   繁体   English

如何在sql中一次执行两个存储过程

[英]How can I execute two stored procedure at a time in sql

I have two stored procedures input_data and Processing_data . 我有两个存储过程input_dataProcessing_data The input_data sends data to the Processing_data and it will send back another id to the input_data . input_data将数据发送到Processing_data ,它将另一个ID input_datainput_data So I need to run both the stored procedure at a same time? 因此,我需要同时运行两个存储过程吗? How can I do this? 我怎样才能做到这一点? Please help me. 请帮我。 Thanks in advance. 提前致谢。

I don't think we need to know the DB system to answer this. 我认为我们不需要了解数据库系统来回答这个问题。 You call from input_data procedure the processing_data procedure, which will do something and then return the values back to input_data, right? 您从input_data过程调用processing_data过程,该过程将执行某些操作,然后将值返回给input_data,对吗?

Here's one example, but the actual implementation will depend on what system you're using: 这是一个示例,但是实际的实现取决于您所使用的系统:

CREATE PROCEDURE input_data AS
   DECLARE @return_val INT
   EXEC  @return_val = processing_data(some_other_value)
   PRINT 'Done'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM