34,837
社区成员




--存储过程B
if object_id('B')is not null drop proc B
go
create proc B
@intcount int output
AS
begin
set @intcount=55;
end
go
--存储过程A,A调用B
if object_id('A')is not null drop proc A
go
create proc A
AS
declare @intcount int
exec B @intcount output
print @intcount
go
--执行存储过程A
exec A
--结果
55
create proc b
@in int out
as
set @in=10
go
create proc a
as
declare @x int
exec b @x out
print @x
if object_id('proc_b')is not null drop proc proc_b
go
create proc proc_b
@intcount int output
AS
set @intcount=55;
go
declare @intcount int
exec proc_b @intcount output
print @intcount
/*55
*/