sql2005生成資料字典

2021-04-16 22:31:49 字數 1575 閱讀 2595

sql2005

生成資料字典

分類:

資料庫技術

2007.1.31 10:25

海浪|

0| 閱讀:

1734

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)

標識,

(case when (select count(*)

from sysobjects

where (name in

(select name

from sysindexes

where (id = a.id) and (indid in

(select indid

from sysindexkeys

where (id = a.id) and (colid in

(select colid

from syscolumns

where (id = a.id) and (name = a.name))))))) and

(xtype = 'pk'))>0 then '√' else '' end)

主鍵,

b.name

型別,

a.length

占用位元組數

, columnproperty(a.id,a.name,'precision') as

長度,

isnull(columnproperty(a.id,a.name,'scale'),0) as

小數字數

, (case when a.isnullable=1 then '√'else '' end)

允許空,

isnull(e.text,'')

預設值,

isnull(g.[value],'') as

字段說明

from  syscolumns  a left join systypes b

on  a.xtype=b.xusertype

inner join sysobjects d

on a.id=d.id  and  d.xtype='u' and  d.name<>'dtproperties'

left join syscomments e

on a.cdefault=e.id

left join sys.extended_properties g

on a.id=g.major_id and a.colid = g.major_id

order by a.id,a.colorder

源文件 <

sql2008生成資料字典

select 表名 case when a.colorder 1 then d.name else end,表說明 case when a.colorder 1 then isnull f.value,else end,字段序號 a.colorder,欄位名 a.name,標識 case when ...

sql Server 2012 生成資料字典

select 表名 case when a.colorder 1 then d.name else end,表說明 case when a.colorder 1 then isnull f.value,else end,字段序號 a.colorder,欄位名 a.name,標識 case when ...

php生成資料字典

生成mysql資料字典 配置資料庫 dbserver 127.0.0.1 dbusername 賬號 dbpassword 密碼 database 資料庫 其他配置 title 資料字典 mysql conn mysql connect dbserver dbusername dbpassword ...