one proc calls another and gets output params?
I would like one stored procedure to call a second stored procedure and
get back some values from the OUTPUT parameters. What is the proper way
for a stored proc to get back OUTPUT values from another proc it has
called (i.e. executed)? The example in SQL Server Books Online does not
seem to work:
CREATE PROCEDURE SampleProcedure @EmployeeIDParm INT,
@MaxQuantity INT OUTPUT
AS
..
.. <snip>
..
RETURN @ErrorSave
the call:
DECLARE @ReturnStatus INT
DECLARE @MaxQtyVariable INT
EXECUTE @ReturnStatus = SampleProcedure @EmployeeIDParm = 9,
@MaxQtyVariable = @MaxQuantity OUTPUT
When I try something ****ogous, the EXECUTE fails with an error like
"@MaxQuantity must be declared."
TIA!
Timo
|