if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[yourTableName]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[yourTableName]
GO

解决方案 »

  1.   

    if exists (select * from sysobjects where id = object_id('dbo.T_PCMSDET_INV_D') and sysstat & 0xf = 8)
    drop trigger dbo.T_PCMSDET_INV_D
    GO
      

  2.   

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[yourTableName]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[yourTableName]
    GO
      

  3.   

    if exists (select name from sysobjects where name='[yourTableName]') and type ='U')
    drop table [yourTableName]
    GO
      

  4.   

    监测 表bg :
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bg]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)监测 存储过程bg :
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[bg]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
      

  5.   

    if exists(select 1 from sysobjects where name='表名' and xtype='u')
      drop table 表名