Sql判断数据库、表、存储过程、函数是否存在
2012-06-08 12:42
519 查看
判断数据库是否存在
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 ='全文目录名称'
文章源自:烈火网,原文:http://www.veryhuo.com/a/view/12445.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 ='全文目录名称'
文章源自:烈火网,原文:http://www.veryhuo.com/a/view/12445.html
相关文章推荐
- MS SQL 中判断 数据库, 存储过程,表,临时表,视图,函数,用户,用户创建对象 等是否存在 SQL脚本
- SQL常用命令之判断数据库、函数、存储过程、表、视图等是否存在
- SQL判断数据库、表、存储过程、视图、函数是否存在
- SqlServer判断数据库、表、存储过程、函数是否存在
- sql server 判断数据库、函数、表、存储过程、视图是否存在的方法
- Sql Server判断数据库、表、存储过程、函数是否存在
- SQL Server判断数据库、表、存储过程、函数是否存在
- Sql中判断“数据库"、"表"、"临时表"、"存储过程"和列”是否存在
- SqlServer判断数据库、表、字段、存储过程、函数是否存在
- SQL Server判断数据库、表、存储过程、函数是否存在
- Sql Server判断数据库、表、存储过程、函数是否存在
- SqlServer判断数据库、表、字段、存储过程、函数是否存在
- SQL脚本判断数据库、函数、 存储过程等是否存在的方法
- sql 判断数据库,表,存储过程等是否存在的代码
- sql 判断数据库,表,存储过程等是否存在的代码
- sql sever-T-SQL 判断 是否存在(数据库,表,存储过程,约束。。。和列)
- SQL判断某个表、存储过程、触发器、函数、某个字段是否存在
- 【转】如何判断SQL中是否已经存在某表、存储过程、函数等
- Sql Server判断数据库、表、存储过程、函数是否存在
- SqlServer判断数据库、表、存储过程、函数是否存在