0
我正在执行一个任务,在其中创建存储过程“sp_master”。从另一个存储过程调用存储过程,并将第一个存储过程的值传递到第二个存储过程
从该存储过程中,我读入所需的外部数据,内部数据,然后执行所有必需的逻辑,以确定输入的信息是否有效。
然后我需要从“sp_master”存储过程调用存储过程“sp_insert”。从“sp_insert”存储过程中,我需要使用读入“sp_master”存储过程的外部数据向表中添加一行。
我知道如何从另一个调用存储过程的存储过程,但我不知道如何在带来价值,这正是我需要
这里的帮助是我的代码片段给了解
Create proc sp_master
@DeliveryID int, @FreightID int, @NoOfGoods int
as
--Perform reads and logic
begin
EXECUTE sp_Insert_delivery
end
然后从sp_Insert
Create proc sp_exam_Insert_delivery
as
begin try
insert into dbo.Delivery
(FreightID, DeliveryID, NoOfGoods)
Values
(@FreightID, @DeliveryID, @NoOfGoods)
end try
--followed by catch