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)
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)
转载于:https://www.cnblogs.com/archip/archive/2013/01/08/2850949.html