select *, indentity(int,1,1) id into #t1 from a
select *, indentity(int,1,1) id into #t2 from b
select a.col1, a.col2, b.col3, b.col4 from #t1 a, #t2 b wher a.id = b.id
select *, indentity(int,1,1) id into #t2 from b
select a.col1, a.col2, b.col3, b.col4 from #t1 a, #t2 b wher a.id = b.id
select identity(int,1,1)id,* into #t1 from A
select identity(int,1,1)id,* into #t2 from B
select * from #t1 a,#t2 b where a.id=b.id