可以定义一个表变量做为output参数。
也可以直接
insert into #temp exec proc_name

解决方案 »

  1.   

    存储过程执行的最后一个语句是select的话,用记录集对象取command的执行结果,就可以返回记录集,是只读的。存储过程中的output是取回返回值用的。
      

  2.   

    在存储过程的最后加上这个select就会返回你需要的记录集了。
      

  3.   

    还可以返回多个SELECT记录集,使用NEXTRECORDS来读取
      

  4.   


    give you a sample!create proc test
    as
    select productid,productname from products where productid>100
    goafter you finished created this procyou can do it as following:declare @result int 
    exec @result=test
      

  5.   

    jianzhongma(jianzhongma) 的例子里的@result里存是test的执行状态吧?
      

  6.   

    create proc proc_orders
    @orderid int,
    @quantity int output
    as
    select @quantity=quantity from orders where orderid=@orderid
    goafter creating proc
    you can do it as the following:
    declare @orders_quantity int
    exec proc_orders
    @orderid='10058',
    @quantity=@orders_qunatity output
    select "quantity"=@orders_quantityI think this is the answer you want to get!
      

  7.   

    从jianzhongma(jianzhongma)的答案里受了启发,
    不过我要是同时想要orderid=n 和orderid=m的结果呢
    用一个过程做的,好像我说的有点问题,你们就看着办吧:)