如下sql语句为什么会出问题:
create table t1 (a int,b int)
select * into #t2 from t1
alter table #t2 add c int
alter table #t2 drop column c
insert into t1 select * from #t2
如下sql语句为什么会出问题: create table t1 (a int,b int) select * into #t2 from t1 alter table #t2 add c int alter table #t2 drop column c insert into t1 select * from #t2 报告列值与表定义不匹配 如果再alter table 后面加上go 语句在查询分析器里可以执行,但是我在程序里面无法使用go语句,应该怎么解决?
create table t1 (a int,b int)
select * into #t2 from t1
exec('alter table #t2 add c int')
exec('alter table #t2 drop column c')
exec('insert t1 select * from #t2')