统计数据库对象
2016-01-22 16:00
363 查看
select case xtype when 'C' then '约束' when 'D' then '默认值约束' when 'F' then '外键约束' when 'FN' then '标量函数' when 'IF' then '内嵌表函数' when 'K' then '主键约束' when 'L' then '日志' when 'P' then '存储过程' when 'R' then '规则' when 'RF' then '复制筛选存储过程' when 'S' then '系统表' when 'TF' then '表函数' when 'TR' then '触发器' when 'U' then '用户表' when 'V' then '视图' when 'X' then '扩展存储过程' when 'AF' then '聚合函数' when 'FS' then '标量函数' when 'FT' then '表值函数' when 'IF' then '内联表函数' when 'IT' then '内部表' when 'PC' then '存储过程' when 'FS' then '标量函数' when 'PK' then '主键约束' when 'SN' then '同义词' when 'SQ' then '服务队列' when 'TA' then '程序集 (CLR) DML 触发器' when 'TT' then '表类型' when 'UQ' then 'UNIQUE 约束(type 为 K)' end as 类型, count(1) as 数量 from dbo.sysobjects group by case xtype when 'C' then '约束' when 'D' then '默认值约束' when 'F' then '外键约束' when 'FN' then '标量函数' when 'IF' then '内嵌表函数' when 'K' then '主键约束' when 'L' then '日志' when 'P' then '存储过程' when 'R' then '规则' when 'RF' then '复制筛选存储过程' when 'S' then '系统表' when 'TF' then '表函数' when 'TR' then '触发器' when 'U' then '用户表' when 'V' then '视图' when 'X' then '扩展存储过程' when 'AF' then '聚合函数' when 'FS' then '标量函数' when 'FT' then '表值函数' when 'IF' then '内联表函数' when 'IT' then '内部表' when 'PC' then '存储过程' when 'FS' then '标量函数' when 'PK' then '主键约束' when 'SN' then '同义词' when 'SQ' then '服务队列' when 'TA' then '程序集 (CLR) DML 触发器' when 'TT' then '表类型' when 'UQ' then 'UNIQUE 约束(type 为 K)' end
本文出自 “sukun” 博客,请务必保留此出处http://sukunwu.blog.51cto.com/10453116/1737671
相关文章推荐
- oracle AWR报告DB time和DB cpu
- 【转】不用程序mysql也可以查询今天、昨天、7天、近30天、本月、上一月的数据
- SQL Performance Analyzer
- mysqladmin命令修改Mysql密码
- MySQL 表分区梳理
- Oracle数据文件物理删除后的恢复
- xampp修改mysql数据库密码
- Sql Server 2016中增加了对JSON的内置支持
- mysql not in 或in 优化
- 【转】MYSQL 存储过程定时操作数据库
- Sql Server 2016中增加了对JSON的内置支持
- 微软SqlServerHelper
- mysql中myisamchk命令使用总结
- MySql—解压缩版本的安装与配制
- vc获取Access/ SqlServer 获取主键
- sql基础05
- MySql的存储引擎
- sql语法:inner join on, left join on, right join on详细使用方法
- centos6.5下编译安装mariadb-10.0.20
- centos6.5下编译安装mariadb-10.0.20