找出数据库中有多少张表
今天在网上找到一些有用的SQL语句。收藏留以后使用。
SELECT * FROM sysobjects WHERE (xtype = 'U')
SELECT * FROM sysobjects WHERE (xtype = 'U')
SELECT * FROM sysobjects WHERE (xtype = 'C')
SELECT * FROM sysobjects WHERE (xtype = 'D')
SELECT * FROM sysobjects WHERE (xtype = 'F')
SELECT * FROM sysobjects WHERE (xtype = 'L')
SELECT * FROM sysobjects WHERE (xtype = 'FN')
SELECT * FROM sysobjects WHERE (xtype = 'IF')
SELECT * FROM sysobjects WHERE (xtype = 'P')
SELECT * FROM sysobjects WHERE (xtype = 'PK')
SELECT * FROM sysobjects WHERE (xtype = 'RF')
SELECT * FROM sysobjects WHERE (xtype = 'S')
SELECT * FROM sysobjects WHERE (xtype = 'TR')
SELECT * FROM sysobjects WHERE (xtype = 'U')
SELECT * FROM sysobjects WHERE (xtype = 'UQ')
SELECT * FROM sysobjects WHERE (xtype = 'V')
SELECT * FROM sysobjects WHERE (xtype = 'X')
--C = CHECK 约束
--D = 默认值或 DEFAULT 约束
--F = FOREIGN KEY 约束
--L = 日志 --FN = 标量函数
--IF = 内嵌表函数
--P = 存储过程
--PK = PRIMARY KEY 约束(类型是 K)
--RF = 复制筛选存储过程
--S = 系统表
--TF = 表函数
--TR = 触发器
--U = 用户表
--UQ = UNIQUE 约束(类型是 K)
--V = 视图
--X = 扩展存储过程