判断sqlserver临时表等临时资源是否存在

 if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#TEMP'))
  drop table #TEMP

原文地址:https://www.cnblogs.com/fhuafeng/p/3596024.html