select identity(int,1,1) as id,* into #tempA from tableA
select identity(int,1,1) as id,* into #tempB from tableB
select a.field1,a.field2...,b.field1,... into tableC from #tempA a,#tempB b where a.id=b.id