日期:2014-05-18  浏览次数:20444 次

怎么用临时表保存存储过程返回的值


怎么用临时表保存存储过程返回的值

临时表     exec     存储过程

select   字段   from   表   where   id   in   (select   id   from   临时表   wher   name   =   '其他 ')

功能就是这样的。

------解决方案--------------------
create table #(......)

insert into # exec 存储过程

select 字段 from 表 where id in (select id from # wher name = '其他 ')

------解决方案--------------------
临时表的结构必须已知且必须在执行存储过程之前创建。