SQL判断临时表是否存在

[复制链接]
查看11 | 回复1 | 2012-11-15 20:19:05 | 显示全部楼层 |阅读模式
判断临时表是否存在Way 1if(exists(select name from tempdb..sysobjects where name like'%temptab%' and type='U'))drop table #temptabWay 2 if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempcitys') and type='U')drop table #tempcitysWay 3IF OBJECT_ID('tempdb..#') IS NOT NULLDROP TABLE #OBJECT_ID此函数返回数据库对象标识号...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行