insert into #tmp
Select * from a
Union all
select * from b
union all
select * from c
union all
select * from d或
Select * into #tmp from a
union all
select * from b
union all
select * from c
union all
select * from d

解决方案 »

  1.   

    --如果过滤掉重复记录,用union
    insert into #temp
    Select * from a
    Union 
    select * from b
    union 
    select * from c
    union 
    select * from d--否则,用union all
    Select * into #temp from a
    union all
    select * from b
    union all
    select * from c
    union all
    select * from d
      

  2.   

    create view view_1
    as
    Select * from a
    Union all
    select * from b
    union all
    select * from c
    union all
    select * from d
    go
    insert into #tmp select * from view_1