if exists(select * from sysobjects where id=object_id('tablename') and type='u' ) print '存在该表' else print '不存在该表'
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[table name]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[table name]
print '存在该表'
else
print '不存在该表'
drop table [dbo].[table name]