首页 > 其他 > 详细

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

时间:2018-07-12 17:54:37      阅读:145      评论:0      收藏:0      [点我收藏+]
--下面以临时表#temp为例,判断它是否存在,存在就删除它 IF OBJECT_ID('tempdb..#temp') is not null drop table #temp --方法一 1if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempcitys') and type='U')2    drop table #tempcitys --方法二 if object_id('tempdb..#tem') is not null  begin  print 'exists'  end  else  begin  print 'not exists'  end


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

原文:http://blog.51cto.com/13866219/2141064

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!