紧急提问 exec 与在sql查询器区别的问题
declare @sql nvarchar(1000)
set @sql =' select 1 as i into #temp;alter table #temp add id int identity(1,1);select id from #temp;drop table #temp;'
exec(@sql)
以上这段代码执行会出错,因为我动态在#temp中加了个字段,但是好象没有应用
但把以上代码不用exec直接执行可以
加go也不行
谁能帮解决,不胜感激!!!!!(对不起各位,只有30分了)