Get ALL table and column descriptions in MSSQL

This article was posted more than 1 year ago. Please keep in mind that the information on this page may be outdated, insecure, or just plain wrong today.

Get MS_Description from all tables AND columns in a database. Suh-weet.

SELECT          u.name + '.' + t.name AS ,
            td.value AS [table_desc],
                c.name AS [column],
                cd.value AS [column_desc]
FROM            sysobjects t
INNER JOIN  sysusers u
    ON          u.uid = t.uid
LEFT OUTER JOIN sys.extended_properties td
    ON          td.major_id = t.id
    AND         td.minor_id = 0
    AND         td.name = 'MS_Description'
INNER JOIN  syscolumns c
    ON          c.id = t.id
LEFT OUTER JOIN sys.extended_properties cd
    ON          cd.major_id = c.id
    AND         cd.minor_id = c.colid
    AND         cd.name = 'MS_Description'
WHERE t.type = 'u'
--ORDER BY    t.name, c.colorder
ORDER BY , [column] ASC -- for my own use

Source: http://stackoverflow.com/a/887414