Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Nested Stored Procedures

Author  Topic 

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2002-06-03 : 14:12:46
Hiya,
How do I assign the return value of a stored proc. into a variable in the calling stored procedure?

Sarah Berger MCSD

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-06-03 : 14:16:20
quote:
Syntax
Execute a stored procedure:


[[EXEC[UTE]]
{
[@return_status =]
{procedure_name [;number] | @procedure_name_var
}
[[@parameter =] {value | @variable [OUTPUT] | [DEFAULT]]
[,...n]
[WITH RECOMPILE]

--SQL Server 7, Books Online



example:

declare @return_value int
exec @return_value = usp_myproc
select @return_value

 


<O>
Go to Top of Page

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2002-06-03 : 14:30:15
Thanks a lot! Very good, clear answer.

Sarah Berger MCSD
Go to Top of Page
   

- Advertisement -