用临时表在proc a...
create table #(...)insert #(...)
exec proc_b 参数
...

解决方案 »

  1.   

    --建立測試環境
    Create Table TEST
    (ID int,
     Name Varchar(100))
    Insert TEST Select 1,'a'
    Union All Select 2,'b'
    GO
    --建立存儲過程
    Create Proc ProcTestA
    As
    Select * from TEST
    GO
    Create Proc ProcTestB
    As
    Begin
    Create Table #T (ID int, Name Varchar(100))
    Insert #T EXEC ProcTestA 
    Select * from #T Where ID=1
    End
    GO
    --測試
    EXEC ProcTestB
    GO
    --刪除測試環境
    Drop Table TEST
    Drop Proc ProcTestA,ProcTestB
    GO
    --結果
    /*
    ID Name
    1 a
    */
      

  2.   

    --创建临时表.或者重新更改存储过程A.把存储过程B实现的功能,追加到存储过程A中.