if object_id('tempdb..#tempTable') is not null Begin DROP TABLE #tempTable End
测试好用
方法函数:if object_id( '【关键字:】tempdb ..【虚拟表名字:】 #tempTable') is not nullBegin DROP TABLE #tempTableEnd