查找字段的备注信息

SELECT  
    [Table Name] = OBJECT_NAME(c.object_id), 
    [Column Name] = c.name, 
    [Description] = ex.value  
FROM  
    sys.columns c  
LEFT OUTER JOIN  
    sys.extended_properties ex  
ON  
    ex.major_id = c.object_id 
    AND ex.minor_id = c.column_id  
    AND ex.name = 'MS_Description'  AND class_desc = 'OBJECT_OR_COLUMN'
WHERE c.object_id = object_id('repKPIByMonth')
ORDER  BY OBJECT_NAME(c.object_id), c.column_id