如何获取MSSQLServer,Oracel,Access中的数据字典信息
,sysindexesi
,sysobjectspc_obj
where
permissions(fc_obj.parent_obj) != 0
and fc_obj.xtype= 'F'
and r.constid = fc_obj.id
and r.rkeyid = i.id
and r.rkeyindid = i.indid
and r.rkeyid = pc_obj.id
内容来自dedecms
------------------------------------------ ORACLE ---------------------------------------------------- 织梦内容管理系统
--表信息
select * from all_tab_comments t
where owner='DBO'
--列信息
select * from all_col_comments t
where owner='DBO' 织梦内容管理系统
--主键、外键对照
select OWNER, CONSTRAINT_NAME, CONSTRAINT_TYPE, TABLE_NAME, R_OWNER, R_CONSTRAINT_NAME
from all_constraints
where owner='DBO' and (Constraint_Type='P' or Constraint_Type='R') 织梦好,好织梦
--主键、外键信息
select *
from all_cons_columns
where owner='DBO'
order by Constraint_Name, Position
-------------------------------------------- Access ----------------------------------------------------
//Access中的系统表MSysobjects存储属性的字段是二进制格式,不能直接分析
//可以采用ADO自带的OpenSchema方法获得相关信息 内容来自dedecms
//use ADOInt.pas
//po: TableName
//DBCon:TADOConnection
/ds:TADODataSet
--表信息
DBCon.OpenSchema(siTables, VarArrayOf([Null, Null, 'Table']), EmptyParam, ds); 本文来自织梦
--列信息
DBCon.OpenSchema(siColumns, VarArrayOf([Null, Null, 'po']), EmptyParam, ds);
--主键
DBCon.OpenSchema(siPrimaryKeys, EmptyParam, EmptyParam, ds);
--主键、外键对照
DBCon.OpenSchema(siForeignKeys, EmptyParam, EmptyParam, ds); 织梦好,好织梦
文章评论
共有位Admini5网友发表了评论 查看完整内容