Thursday, March 29, 2012

Getting the return from a stored procedure from within a stored

Im trying to get stp1 to get the return value from stp2. stp2 returns
a int. Here is the code that I used in stp1
delcare @.return as in
set @.return = (dbo.stp2 (PARAM1, PARAM2))
I have tried different way to execute this but I get a error:
"Msg 4121, Level 16, State 1, Procedure stp1, Line 58 Cannot find
either column "dbo" or the user-defined function or aggregate
"dbo.stp2", or the name is ambiguous."
Is there a way to get the return value of a stored procedure from
within a stored procedure?Try :
declare @.return int
EXEC stp2 @.ValuePassed, @.return OUTPUT
PRINT @.return
Also , you need to make sure stp2 , is set up appropriately
Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com
"TheVillageCodingIdiot" <whosyodaddy1019@.hotmail.com> wrote in message
news:6d0de7c3-e56c-4fba-8886-8cf70a60d646@.i72g2000hsd.googlegroups.com...
> Im trying to get stp1 to get the return value from stp2. stp2 returns
> a int. Here is the code that I used in stp1
> delcare @.return as in
> set @.return = (dbo.stp2 (PARAM1, PARAM2))
> I have tried different way to execute this but I get a error:
> "Msg 4121, Level 16, State 1, Procedure stp1, Line 58 Cannot find
> either column "dbo" or the user-defined function or aggregate
> "dbo.stp2", or the name is ambiguous."
> Is there a way to get the return value of a stored procedure from
> within a stored procedure?|||declare @.return int
exec @.return =3D dbo.stp2 @.PARAM1, @.PARAM2
select @.return
Denis The SQL Menace
http://sqlservercode.blogspot.com
http://sqlblog.com/blogs/denis_gobo/default.aspx
On Jan 24, 9:44=A0am, TheVillageCodingIdiot
<whosyodaddy1...@.hotmail.com> wrote:
> Im trying to get stp1 to get the return value from stp2. stp2 returns
> a int. Here is the code that I used in stp1
> delcare @.return as in
> set @.return =3D (dbo.stp2 (PARAM1, PARAM2))
> I have tried different way to execute this but I get a error:
> "Msg 4121, Level 16, State 1, Procedure stp1, Line 58 Cannot find
> either column "dbo" or the user-defined function or aggregate
> "dbo.stp2", or the name is ambiguous."
> Is there a way to get the return value of a stored procedure from
> within a stored procedure?

No comments:

Post a Comment