统计数据库对象

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
时间: 2024-07-29 04:42:33

统计数据库对象的相关文章

sp_MSforeachdb&sp_MSforeachtable&sp_MSforeachobject&查看某个对象的依赖对象

--查看某个对象的依赖对象 EXEC sp_MSforeachdb 'use ? ; IF EXISTS(SELECT top 1 1 FROM sys.syscomments WHERE text LIKE ''%test%'') SELECT ''?'' as dbname,object_name(id) as object FROM sys.syscomments WHERE text LIKE ''%test%''' --统计数据库里每个表的详细情况 exec sp_MSforeacht

[VBA]统计数据库表格总笔数

之前帮同事做过总笔数的查询 [SQL]检查数据库表格总笔数 改成VBA的版本 程序结构 表单(SubConnectString) Private Sub cmd_Confirm_Click() If txt_IP.Text = "" Or txt_Account.Text = "" Or txt_PWD.Text = "" Then MsgBox "请输入连线相关资讯" Exit Sub End If GetConnectSt

通过jQuery Ajax使用FormData对象上传文件

转自:http://www.cnblogs.com/labnizejuly/p/5588444.html FormData对象,是可以使用一系列的键值对来模拟一个完整的表单,然后使用XMLHttpRequest发送这个"表单". <form id="uploadForm" enctype="multipart/form-data"> <input id="file" type="file"

对象序列化和反序列--Hibernate的查询和新增极其相似

Hibernate几个关键字持久化,ORM(关系对象映射)(数据库中关系称作是一张表) 应用在项目中,刘一从写的查询代码,每次都挂掉,想要弄出测试数据,自己想着把查询出来的复杂数据弄到文件里自己要是去造那些复杂数据很麻烦public class Object1 { public static void main(String args[]){ HashMap<String, Object> obj=new HashMap<String,Object>(); obj.put(&quo

C#中XML与对象之间的序列化、反序列化

using System; using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; namespace Xml.Utility { public static class XmlUtil { /// <summary> /// 将一个对象序列化为XML字符串 /// </summary> /// <param name="o">要序列化

菜鸟学python之对象类型及运算

Python 中的变量不需要声明.每个变量在使用前都必须赋值,变量赋值以后该变量才会被创建. 在 Python 中,变量就是变量,它没有类型,我们所说的"类型"是变量所指的内存中对象的类型. 等号(=)用来给变量赋值. 1 变量赋值 1.1 单个变量赋值 >>> name="python" >>> print(name) python 1.2 多个变量赋值 >>> name=names="python&

java 类对象使用

在学习反射机制时,总结一下获得类对象方式: 第一种方式:通过类本身来获得对象 Class<?> classname = this.getClass(); 或者this.class 第二种方式:通过子类的实例获取父类对象 ClassName cn = new ClassName(); UserClass = cn.getClass(); Class<?> SubUserClass = UserClass.getSuperclass(); 第三种方式:通过类名加.class获取对象 C

dbutils封装对象,单列,一行一列(用)

基本用法:查找并封装对象与对象集合 public User findUserByNamePassword(String name,String password){ QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource()); String sql = "select * from user where name='"+name+"' and password = '"+password

Class类 获取Class对象

阅读API的Class类得知,Class 没有公共构造方法.Class 对象是在加载类时由 Java 虚拟机以及通过调用类加载器中的 defineClass 方法自动构造的 获取Class对象的三种方式(实例采用Person类) 方式1:通过Object类的getObject()方法 Person p = new Person(); Class c = p.getClass(); 方式2: 通过 类名.class 获取到字节码文件对象(任意数据类型都具备一个class静态属性,看上去要比第一种方