This question already has an answer here:
i have a Hierarchy of stored procedures calling one in another as below:
1
2
3
Now what i am doing is: first of all i am showing the 1st level sp .
Create proc proc_test3
(
@Id uniqueidentifier,
@value varchar(100)
)
as
declare @Outputvalue varchar(100)
if @Id='2'
begin
exec @Outputvalue= proc_test2 @Id @value
select @Outputvalue
end
Here is the second level :
Create proc proc_test2
(
@Id uniqueidentifier,
@value varchar(100)
)
as
declare @Outputvalue varchar(100)
if @Id='2'
begin
exec @Outputvalue= proc_test1 @Id @value
select @Outputvalue
end
and here is last 3rd level :
Create proc proc_test1
(
@Id uniqueidentifier,
@value varchar(100)
)
as
update tblsample set value=@value where id=@Id
select 1
I have paste just an example but in-actual my code is much complex to read, so i have implemented it in some simpler way so that every can understand it easily,
Now what is my problem: every time i got @Outputvalue=0 when i execute the "proc_test3", please help me so that i can come out from this prob, if i am doing the things in some wrong way please let me know the right way, please help me resolve the issue.