http://reddymsbitools.blogspot.com

Saturday, 26 February 2011

recussive stored procedure

create
procedure proc_all(@eno int,@add int output)

as

begin

select
@add=@eno+5

return

end

create
procedure proc_1(@eno int,@mul int output)

as

begin

select
@mul=@eno*5

return

end

alter
procedure proc_2(@eno int)

as

begin

declare
@x int

declare
@mul int

declare
@add int

--declare @add int

exec
proc_all @eno,@add output

exec
proc_1 @eno,@mul output

select
@x=@add+@mul

select
@x as result

return

end

exec
proc_2 8

No comments:

Post a Comment