Hello everyone. I've been trying to find if this is even possible but nothing I've found has really helped.
I've got a stored proc with a few input parameters and one output parameter. I would like to call this proc from another proc and have proc 2 return the result of proc1 as a column. Some thing like this
create procedure Proc1
@Input1 numeric,
@Input2 varchar(20),
@Input3 money output
as
Select @Input3 = Amount from Table where ...
go
create procedure Proc2
@Input4 numeric,
@Input5 numeric
as
Select Column1, Column2, (exec Proc1 input1,input2, input3 output) as Column3
from table 2
where ...
Is this sort of thing even possible? Basically I need some of the results from Proc2 as inputs into Proc1 and return a single result from Proc2.
Thanks in advance.
Stephen