create table test(id int,name varchar(10))
insert into test select 1,'AAAA'
insert into test select 2,'BBBB'
gocreate procedure sp_test1(@count int output)
as
    select @count=count(*) from test
gocreate procedure sp_test2
as
begin
    declare @count int
    exec sp_test1 @count output 
    select @count
end
goexec sp_test2
go--输出结果
/*
2
*/drop procedure sp_test2,sp_test1
drop table test
go

解决方案 »

  1.   

    create proc kk
    as
    begin
    exec jj  --jj为存储过程名
    end
      

  2.   

    create proc jjyy
    as
    begin
    exec yyjj @K,@W  --yyjj为存储过程名,后面为参数。
    end
      

  3.   

    --转create table test(id int,name varchar(10))
    insert into test select 1,'AAAA'
    insert into test select 2,'BBBB'
    gocreate procedure sp_test1(@count int output)
    as
        select @count=count(*) from test
    gocreate procedure sp_test2
    as
    begin
        declare @count int
        exec sp_test1 @count output 
        select @count
    end
    goexec sp_test2
    go--输出结果
    /*
    2
    */drop procedure sp_test2,sp_test1
    drop table test
    go
      

  4.   

    哈哈,直接这样就行
    panjinfu80(天蓝水晶) ( ) 
    create proc jjyy
    as
    begin
    exec yyjj @K,@W  --yyjj为存储过程名,后面为参数。
    end