判断数据库是否存在 if exists (select * from dbo.sysobjects where name = '数据库名')

--drop database [数据库名]

判断表是否存在 if exists (select * from dbo.sysobjects where id = object_id(N'[表名]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

--drop table [表名]

判断存储过程是否存在 if exists (select * from dbo.sysobjects where id = object_id(N'[存储过程名]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)

-- drop procedure [存储过程名]

判断函数是否存在 IF OBJECT_ID (N'函数名') IS NOT NULL DROP FUNCTION dnt_split

判断数据库是否开启了全文搜索 select databaseproperty('数据库名','isfulltextenabled')

判断全文目录是否存在 select * from sysfulltextcatalogs where name ='全文目录名称'


判断数据库是否存在 if exists (select * from dbo.sysobjects where name = '数据库名')

--drop database [数据库名]

判断表是否存在 if exists (select * from dbo.sysobjects where id = object_id(N'[表名]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

--drop table [表名]

判断存储过程是否存在 if exists (select * from dbo.sysobjects where id = object_id(N'[存储过程名]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)

-- drop procedure [存储过程名]

判断函数是否存在 IF OBJECT_ID (N'函数名') IS NOT NULL DROP FUNCTION dnt_split

判断数据库是否开启了全文搜索 select databaseproperty('数据库名','isfulltextenabled')

判断全文目录是否存在 select * from sysfulltextcatalogs where name ='全文目录名称'

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2021-07-03
  • 2021-07-30
  • 2022-12-23
  • 2021-12-17
  • 2022-02-10
猜你喜欢
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-01-04
  • 2022-01-07
  • 2022-02-05
相关资源
相似解决方案