select top (100) percent
case when a.colorder = 1 then d .name else '' end as 表名, case when a.colorder = 1 then isnull(f.value, '')
else '' end as 表說明, a.colorder as 字段序號, a.name as 欄位名, case when columnproperty(a.id, a.name, 'isidentity')
= 1 then '√' else '' end as 標識, case when exists
(select 1 from dbo.sysindexes si inner join
dbo.sysindexkeys sik on si.id = sik.id and si.indid = sik.indid inner join
dbo.syscolumns sc on sc.id = sik.id and sc.colid = sik.colid inner join
dbo.sysobjects so on so.name = so.name and so.xtype = 'pk'
where sc.id = a.id and sc.colid = a.colid) then '√' else '' end as 主鍵, b.name as 型別, a.length as 長度, columnproperty(a.id, a.name,
'precision') as 精度, isnull(columnproperty(a.id, a.name, 'scale'), 0) as 小數字數,
case when a.isnullable = 1 then '√' else '' end as 允許空, isnull(e.text, '') as 預設值, isnull(g.value, '') as 字段說明, d.crdate as 建立時間,
case when a.colorder = 1 then d .refdate else null end as 更改時間
from dbo.syscolumns as a left outer join
dbo.systypes as b on a.xtype = b.xusertype inner join
dbo.sysobjects as d on a.id = d.id and d.xtype = 'u' and d.status >= 0 left outer join
dbo.syscomments as e on a.cdefault = e.id left outer join
sys.extended_properties as g on a.id = g.major_id and a.colid = g.minor_id left outer join
sys.extended_properties as f on d.id = f.major_id and f.minor_id = 0
order by d.name, 字段序號
SQL Server匯出表結構 資料字典
select case when a.colorder 1 then d.name else end 表名,a.colorder 字段序號,a.name 欄位名,case when columnproperty a.id,a.name,isidentity 1 then else end 標識,ca...
國家資料字典mysql mysql的資料字典
因為對元資料 元資料就是那些關於如何資料庫的那些資料 的使用已經變得愈來愈普遍了,mysql5在產品中也相應地設計了乙個專門的資料庫,這個資料庫的固定名稱就是information schema,該資料庫作為乙個中心資料字典的角色出現,其中包含了資料庫的所有物件資訊和其他與資料庫相關的專案 比如安全...
sqlserver 生成資料字典
1,select obj.name as 表名,col.colorder as 序號 col.name as 列名 isnull ep.value as 列說明 t.name as 資料型別 col.length as 長度 isnull columnproperty col.id,col.name...