oracle
select
‘重庆HRP’ 系统,
‘hrp’ 库名,
t.table_name,
comments,
num_rows,
timestamp 最近更新时间
from
user_tables t
left join
user_tab_comments c
on
t.table_name=c.table_name
left join
user_TAB_MODIFICATIONS m
on t.table_name=m.table_name
order by comments
mysql
SELECT
“HRCM后台” 系统名字,
table_schema 数据库名,
table_name,
table_comment,
table_rows,
create_time,
update_time
FROM
information_schema.tables
WHERE
table_schema = ‘xxxxx’
sqlserver
SELECT a.name,
CASE WHEN d.colorder = 1 THEN isnull(f.value, ”) ELSE ” END AS 表说明,
b.rows,create_date,modify_date
FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id
inner join
sys.tables c
on a.name=c.name
inner join
syscolumns d
on a.id=d.id and d.colorder = 1
left join
sys.extended_properties f
on a.id = f.major_id AND f.minor_id = 0 AND f.name = ‘MS_Description’
WHERE (a.type = ‘u’) AND (b.indid IN (0, 1))
ORDER BY 表说明 desc
说明:
sysindexes.indid:
0 = Heap
1 = Clustered index
>1 = Nonclustered index
sysobjects.type:
C = CHECK 约束 D = 默认值或 DEFAULT 约束 F = FOREIGN KEY 约束
FN = 标量函数 IF = 内嵌表函数 K = PRIMARY KEY 或 UNIQUE 约束
L = 日志 P = 存储过程 R = 规则 RF = 复制筛选存储过程
S = 系统表 TF = 表函数 TR = 触发器 U = 用户表 V = 视图 X = 扩展存储过程