判断临时表是否存在,存在则删除

if object_id('tempdb..#regionChildPurchase') is not null   
	Begin  DROP TABLE  #regionChildPurchase  End  

 

if exists(select * from tempdb..sysobjects where id=object_id('tempdb..##TEMP_TBL'))
PRINT '存在' 
ELSE 
PRINT'不存在'

 

posted @ 2016-12-04 19:50  xfyn  阅读(3331)  评论(0编辑  收藏  举报