如何檢視table的字段資訊

2021-03-31 08:56:59 字數 1224 閱讀 3113

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 columnproperty( a.id,a.name,'isidentity')=1 then '√'else '' end,

主鍵=case when exists(select 1 from sysobjects where xtype='pk' and name in (

select name from sysindexes where indid in(

select indid from sysindexkeys where id = a.id and colid=a.colid

))) then '√' else '' end,

型別=b.name,

占用位元組數=a.length,

長度=columnproperty(a.id,a.name,'precision'),

小數字數=isnull(columnproperty(a.id,a.name,'scale'),0),

允許空=case when a.isnullable=1 then '√'else '' end,

預設值=isnull(e.text,''),

字段說明=isnull(g.[value],'')

from syscolumns a

left join systypes b on a.xusertype=b.xusertype

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

left join sys***ments e on a.cdefault=e.id

left join sysproperties g on a.id=g.id and a.colid=g.**allid 

left join sysproperties f on d.id=f.id and f.**allid=0

--where d.name='table_name'      --如果要查詢特定table,加上這句

order by a.id,a.colorder

如何檢視網域名稱的資訊

開啟cmd 1.nslookup 檢視您的網域名稱解析 2.dig ip 您的網域名稱 比如你想看到某個ip解析的網域名稱是 獲取的 dig除錯網域名稱解析問題 2009 08 15 11 01 有使用者報告說訪問不了 m.uushare.com 這個 wget試了一下發現解析不到ip位址。用dig...

如何檢視linux的資訊

檢視cpu資訊 cat proc cpuinfo 其他檢視硬體資訊命令。檢視板卡資訊 cat proc pci 檢視pci資訊 lspci 相比cat proc pci更直觀 檢視記憶體資訊 cat proc meminfo 檢視usb裝置 cat proc bus usb devices 檢視鍵盤...

sql server 檢視字段備註等資訊

select d.name as 英文表名,isnull h.value,n as 中文表名,a.colorder as 字段序號,a.name as 英文列名,isnull g.value,n as 中文列名,case when columnproperty a.id,a.name,isident...