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 |
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2010-08-14 : 19:08:26
|
I am having trouble retrieving a return value from within t-sql.Normally I handle in .net, but because of issues that would take too long to go through, I'm stuck with this.Create procedure myprocasreturn 22 I need to call that procedure from within anothercreate procedure test2asdeclare @myval intexec @myval = myproc Anyone know of a way in t-sql to set @myval to the myproc returnval?Thanks Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-08-14 : 19:28:33
|
with output parametersCreate procedure myproc @returnVal intasSet @returnVal = 22;GOcreate procedure test2asdeclare @myval intexec myproc @myvalGO |
 |
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2010-08-14 : 19:35:36
|
Can't do that, It's not my procedure, so I cannot change it.I need to retrieve the value off this specifically (Obviously this is not the exact procedure, but I am trying to illustrate getting the RETURNED VALUE, when it is not set to a select or a output variable)Thankscreate procedure myprocasreturn 22go Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-08-14 : 22:54:30
|
DBCC OUTPUT BUFFER(spid) |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-15 : 03:36:48
|
http://www.sqlteam.com/article/stored-procedures-returning-data------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|