sql server用SQL语句查看字段说明

SELECT t.[name] AS 表名,c.[name] AS 字段名,cast(ep.[value] 
as varchar(100)) AS [字段说明]
FROM sys.tables AS t
INNER JOIN sys.columns 
AS c ON t.object_id = c.object_id
LEFT JOIN sys.extended_properties AS ep 
ON ep.major_id = c.object_id AND ep.minor_id = c.column_id WHERE ep.class =1 
AND t.name='表名'

 

posted @ 2019-04-10 11:41  小确幸123  阅读(341)  评论(0编辑  收藏  举报