请教此动态SQL语句 declare @table table(a int,b varchar(40))insert into @table select * from tab上面的这个怎么写成:exec ('insert into '+@table+' select * from tab') 注: 这种是会提示错误。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert into @table exec ('select * from tab') 动态SQL语句中不能使用表变量.如果要用则用临时表比较好如:create table #a(a int,b varchar(40))exec ('insert into #a select * from tab')drop table #a 给你两个链接参考下,有存储过程,有调用,不知道是不是你要的http://hi.baidu.com/84ww/blog/item/695f904be29cbcf282025cca.htmlhttp://hi.baidu.com/84ww/blog/item/9e8b64ee47e29af9b2fb95cb.html 跪求一个sql语句 急救!SQL查询问题 急救,sqlserver启动不了,提示错误1067 还原数据库时提示“发生内部一致性错误。请与技术支持联系以寻求协助。” excel导入问题!! 菜鸟求助:怎么样还原数据库! sql 2000 用replace速度超慢的问题? Select * From City Where CityName = 'Xi'An' 语句出错!急! 高分求教!VFP关于数据导入和导出的问题 sql检查约束执行出错 sql 语法问题 拼字符串 在线等待!谢谢!jdbc的问题
动态SQL语句中不能使用表变量.如果要用则用临时表比较好
如:create table #a(a int,b varchar(40))exec ('insert into #a select * from tab')
drop table #a
http://hi.baidu.com/84ww/blog/item/695f904be29cbcf282025cca.html
http://hi.baidu.com/84ww/blog/item/9e8b64ee47e29af9b2fb95cb.html