可以借助于全局性的临时表,如: create table ##temp, 不过你自己要好好控制它,小心操作。

解决方案 »

  1.   

    swordmanli(太白) and tigerwood12345(tigerwood12345) :谢谢你们的回答
    能不能详细点,最好来点事例,谢谢你们了!
      

  2.   


    你在调用存储过程之前,先建立一个全局性的临时表,如:##temp将你的结果集放入到##temp中调用存储过程,存储过程中对##temp进行操作。
      

  3.   

    或者用全局的游标declare  mycursor cursor global for select col1,col2 from yourtable
    open mycursor这样就可以在存储过程中使用mycursor这个结果集