删除实表的方法:
最容易明白的方法:
if exists (select * from sysobjects where xtype='u' and name='表名' )
drop table 表名
其它:
if exists (select * from sysobjects where xtype='u' and id=Object_id(N'表名') )
drop table 表名
if exists (select * from sysobjects where id = Object_id(N'[dbo].[表名]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table 表名
删除临时表的方法:
if object_id('tempdb..#表名') is not null
drop table #表名