if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tt]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
begin
   ....
end
else
begin
    ...
end

解决方案 »

  1.   

    IF Exists(select Name from sysobjects where Name='yourTable' and Type='U')
    Drop Table yourTableGO
      

  2.   

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

  3.   

    if object_id('表名') is not null 
      drop table [dbo].[m]
      

  4.   

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