Sql Server判断数据库、表、存储过程、函数是否存在
2013-11-06 14:15
453 查看
判断数据库是否存在
if exists (select * from sys.databases where name = '数据库名')
drop database [数据库名]
判断表是否存在
if exists (select * from sysobjects where id = object_id(N'[表名]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [表名]
判断存储过程是否存在
if exists (select * from 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 ='全文目录名称'
原文地址:
/article/8086394.html
if exists (select * from sys.databases where name = '数据库名')
drop database [数据库名]
判断表是否存在
if exists (select * from sysobjects where id = object_id(N'[表名]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [表名]
判断存储过程是否存在
if exists (select * from 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 ='全文目录名称'
原文地址:
/article/8086394.html
相关文章推荐
- Sql Server判断数据库、表、存储过程、函数是否存在
- SQL Server判断数据库、表、存储过程、函数是否存在
- SQL Server判断数据库、表、存储过程、函数是否存在
- Sql Server判断数据库、表、存储过程、函数是否存在
- SQL Server判断数据库、表、存储过程、函数是否存在
- sql server 判断数据库、函数、表、存储过程、视图是否存在的方法
- Sql Server判断数据库、表、存储过程、函数是否存在
- Sql判断数据库、表、存储过程、函数是否存在
- SqlServer判断数据库、表、字段、存储过程、函数是否存在
- SQL SERVER 判断是否存在并删除某个数据库、表、视图、触发器、储存过程、函数
- SqlServer判断数据库、表、存储过程、函数是否存在
- SQL判断数据库、表、存储过程、视图、函数是否存在
- SQL SERVER 判断是否存在并删除某个数据库、表、视图、触发器、储存过程、函数
- SqlServer判断数据库、表、存储过程、函数是否存在
- MS SQL 中判断 数据库, 存储过程,表,临时表,视图,函数,用户,用户创建对象 等是否存在 SQL脚本
- SqlServer判断数据库、表、存储过程、函数是否存在
- SqlServer判断数据库、表、字段、存储过程、函数是否存在
- SQL常用命令之判断数据库、函数、存储过程、表、视图等是否存在
- sql server 判断是否存在数据库,表,列,视图
- SQL Server中判断一个数据库是否存在的方法