This project has moved. For the latest updates, please go here.

Getting each Column Descriptions

Apr 29, 2013 at 6:17 AM
Edited Apr 29, 2013 at 9:09 AM
is it possible to read the Column Description values
as well as the Extended Properties for each table
for SQL Server 2012.

i have been trying to follow the logic
Thanks .. this is the best project ever.. amazing code practices too
Apr 29, 2013 at 8:57 AM
Edited Apr 29, 2013 at 9:40 AM
my question is how to write the SQL statement, because I only get null values for the description and I added some descriptions on a few columns)
Apr 30, 2013 at 7:17 AM
It's already in the latest code (SqlServerSchemaReader.ColumnDescription)
Minus the table/schema selection, the SQL I use is below (minus the table and schema restrictions):
    SchemaOwner =, 
    TableName =,
    ColumnName =,
    ColumnDescription = p.value
FROM sysobjects o
INNER JOIN syscolumns c
    ON =
INNER JOIN  sys.schemas s
    ON s.schema_id = o.uid
INNER JOIN sys.extended_properties p 
    ON p.major_id =
    AND p.minor_id = c.colid
    AND = 'MS_Description'
    o.type= 'U' 
It's an inner join to sys.extended_properties, as if there are no descriptions I don't need the full result set (less data to process).
May 11, 2013 at 1:44 AM
Edited May 11, 2013 at 1:44 AM
and Ward Bell
are the best developers i know of