浩晨众云网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
--下面以临时表#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