不好意思 上面有问题 应该是 select * into #temp from table1,table2
select table1.*,table2.* into #temp from table1,table2
alter table table1 add id int identity(1,1) not null alter table table2 add id int identity(1,1) not null go select a,b,c,d from table1 a full join table2 b on a.id=b.id go alter table table1 drop column id go
上面有问题
应该是
select *
into #temp
from table1,table2
alter table table2 add id int identity(1,1) not null
go
select a,b,c,d from table1 a full join table2 b on a.id=b.id
go
alter table table1 drop column id
go