码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2015-03-09 00:35:49      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:sql

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'


 

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

标签:sql

原文地址:http://blog.csdn.net/jayzai/article/details/44141161

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!