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 2005 Forums
 Transact-SQL (2005)
 Output from a Storedprocedure

Author  Topic 

msv
Starting Member

9 Posts

Posted - 2009-08-12 : 16:11:39
How do i capture the output from a storedprocedure (that is called within the main procedure) into local variables???
Need an example.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-08-12 : 16:39:22
Is the output a result set or output parameters?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

msv
Starting Member

9 Posts

Posted - 2009-08-12 : 17:05:06
output parameters
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-08-12 : 17:37:35
Then just put them into variables:

DECLARE @var2 int, @var3 varchar(50)
EXEC SomeProc @var1 = 1, @var2=@var2 OUTPUT, @var3=@var3 OUTPUT

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -