首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

存储过程中不能直接查询数据给临时表吗?该如何处理

2012-09-15 
存储过程中不能直接查询数据给临时表吗?在SQL中语句 select into #aa from test 不用声明表#aa ,在存储过

存储过程中不能直接查询数据给临时表吗?
在SQL中语句 select into #aa from test 不用声明表#aa ,在存储过程中提示未定义,我声明了,好像还要声明所有表的字段,感觉好麻烦,不知道是我不会还是真的要先创建表的字段?

[解决办法]
insert #tt
select *
from test
可以运行!
楼主的那种select * into #tt exec(select * from test)
形式无法运行。
[解决办法]
exec('select * into #a from test')这个是可以运行的!

热点排行