现在的位置: 首页 > 数据库 > 正文

SQL中快速 查询表名称,字段和说明

2018年07月06日 数据库 ⁄ 共 267字 ⁄ 字号 评论关闭
SELECT 
t.[name] AS 表名,
c.[name] AS 字段名,
cast(ep.[value] as nvarchar(200)) 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='T_BrokerWithLook'

 

抱歉!评论已关闭.