--建立
select * into #tempTable from YouTable
--恢复初始状态
truncate table #tempTable

解决方案 »

  1.   

    谢谢。
    有一点可以改进,全取再清空效率低了。可以使用“select * into #tempTable from YouTable where 1=2”一步到位。
      

  2.   

    select top 0 * into #t from 原表
      

  3.   

    select top 0 * into 固定表 from 原表
      

  4.   

    select top 0 * into 固定表 from 原表或select * into 固定表 from 原表 where 1=0
      

  5.   

    select * into #tmp from tableA where 1=2
    select * into ##tmp from tableA where 1=2
    select * into tableB from tableA where 1=2