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.
| Author |
Topic |
|
mccallug
Starting Member
6 Posts |
Posted - 2008-08-14 : 12:35:14
|
| I am creating a recursive stored procedure. I need get the value returned from the stored procedure. I cannot find a way to do this. This is what I have tried so far. My stored procedure only takes one parameter.DECLARE @TEMP intSET @TEMP = EXEC Count_Stock_At_Location 1---Will not run do to incorrect syntax---Does anyone know how to get scalar value back from EXEC Stored_Procedure? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-08-14 : 13:41:34
|
| You should lookup the correct syntax for an EXECUTE statement in SQL Server Books Online.http://msdn.microsoft.com/en-us/library/ms188332(SQL.90).aspxCODO ERGO SUM |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-14 : 13:53:43
|
| either use OUTPUT parameter approach suggested by Tara or just return value as a resultset and use OPENROWSET to return it like belowSELECT @TEMP = returnfieldFROM OPENROWSET(...,'EXEC Count_Stock_At_Location 1')for getting the other settings of OPENROWSET refer books online orhttp://msdn.microsoft.com/en-us/library/ms190312.aspx |
 |
|
|
|
|
|