select * from (存储过程执行并返回的结果表)

select * from (存储过程执行并返回的结果表)

当需要二次查询存储过程执行的结果时就需要利用临时表来解决。

 

create table #temp(id int,dn nvarchar(20),pt int)
insert into #temp exec FindDepartment @id=1

select * from #temp where id in(select id from #temp)

 

posted @ 2013-01-08 13:17  archip  阅读(1559)  评论(0编辑  收藏  举报