sql创建临时表并且插入数据

if OBJECT_ID('tempdb..#temp') is not null
drop table #temp
select * into #temp from 
(
  --select * from Activity
    select 7 as 'month',25 as 'day'
    union all
    select 7 as 'month',25 as 'day'
    union all
    select 8 as 'month',25 as 'day' 
    union all
    select 8 as 'month',25 as 'day'
    union all
    select 8 as 'month',25 as 'day'
 
) as A


select *  from #temp
原文地址:https://www.cnblogs.com/codeDevotee/p/7253721.html