sql獲取指定表全部列名及註釋

SELECT b.name as 字段名
,Type_name(b.xusertype) as 字段類型
, Isnull(c.VALUE,'') as 字段說明
FROM sysobjects a join syscolumns b on a.id = b.id
JOIN sys.extended_properties c
ON b.id = c.major_id
AND b.colid = c.minor_id

WHERE a.id = Object_id('gbpm.JLFFORM3') --要查詢的表改爲你要查詢表的名稱
ORDER BY b.colidobject

相關文章
相關標籤/搜索