Determine if the database exists if exists (SELECT * from dbo.sysobjects WHERE name = ' database name ')
--drop database [DB name]
Determine if the table exists if exists (SELECT * from dbo.sysobjects WHERE id = object_id (n ' [table name] ') and OBJECTPROPERTY (ID, n ' isusertable ') = 1)
--drop table [table name]
Determine if the stored procedure exists if exists (SELECT * from dbo.sysobjects WHERE id = object_id (n ' [Stored procedure name] ') and OBJECTPROPERTY (ID, n ' isprocedure ') = 1)
--drop procedure [Stored procedure name]
Determine if the function exists if object_id (N ' function name ') is not NULL DROP function dnt_split
Determine if the database is open full-text Search select Databaseproperty (' Database name ', ' isfulltextenabled ')
To determine if a full-text catalog exists select * FROM sysfulltextcatalogs where name = ' Full-text catalog name '
< Span style= "color: #494949; Font-family:simsun; font-size:14px; line-height:21px; Background-color: #f5f2ef ">
SQL Server determines a variety of non-existent