all groups > sql server programming > november 2004 >
You're in the

sql server programming

group:

Call a store procedure


RE: Call a store procedure Nigel Rivett
11/7/2004 12:05:06 PM
sql server programming:
You call an SP using exec

exec mysp2

To return data use output parameters
create proc mysp1
as
declare @p1 int, @p2 int, @p3 int
exec mysp2 @p1, @p2 out, @p3 out
select @p2, @p3
go

create proc mysp2
@p1 int, @p2 int out, @p3 int out
as

set @p2 =
set @p3 =
go

To return a resultset usea temp table of the correct structure and

insert #temp
exec mysp2

Have a look in bol.






[quoted text, click to view]
Re: Call a store procedure Yoshi
11/7/2004 2:13:36 PM
The last line of the stored proc you can do this:

SELECT @Var

[quoted text, click to view]

Re: Call a store procedure Tom Moreau
11/7/2004 2:29:14 PM
Try:

create proc MyProc1
as

declare @rc int

exec @rc = exec MyProc2
go


--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
..
[quoted text, click to view]
I need call a store procedure from another and store the return value in a
var.
How can I do it?

Thank you very much

Call a store procedure Alberto
11/7/2004 8:23:10 PM
I need call a store procedure from another and store the return value in a
var.
How can I do it?

Thank you very much

AddThis Social Bookmark Button