由于数据库不同可能对应的SQL语句也不相同,请试试下面语句:
select * from SourceTable into #tmp where false
或
select * into #tmp from SourceTable where false
select * from SourceTable into #tmp where false
或
select * into #tmp from SourceTable where false
这样就创建一个结构一样,但有内容为空的临时表了
select * into ##tmp from SourceTable where false