none
How to get column description from MetaData?

    Question

  •  

    I've tried looking in sys.syscolums and sys.syscomments, but I can't seem to find where the Description information is retain for a Field in the system tables -- any hints?

     

    Thanks, Rob.

    Tuesday, March 25, 2008 2:35 AM

All replies

  • In Books Online, refer to topics:

    • 'Extended Properties'
    • sp_addextendedproperty
    • fn_listextendedproperty

     

    Tuesday, March 25, 2008 2:48 AM
  • you can also use something like (SQL 2005)

     

    SELECT

    c.TABLE_NAME

    ,c.COLUMN_NAME

    ,s.value

    FROM INFORMATION_SCHEMA.COLUMNS c

    INNER JOIN sys.extended_properties s on s.major_Id = OBJECT_ID(c.TABLE_SCHEMA+'.'+c.TABLE_NAME)

    AND s.minor_Id = c.ORDINAL_POSITION

    AND s.name = 'MS_Description'

    Tuesday, March 25, 2008 3:03 AM