Using Enterprise Manager Descriptions

Microsoft SQL Server 2000 introduced a method for providing descriptions for certain objects, or object attributes in the database.  These descriptions are stored in the database as extended properties with a property name of MS_Description.  Any object or object attribute which has a design time description edit box in SQL Enterprise Manager will have its value stored in the MS_Description extended property.  

You can obtain more information on the use of extended properties in general by looking in the SQL Server Books Online (BOL) under the topic "Property Management" and "Using Extended Properties on Database Objects".  It is important to note that while the BOL does describe the usage of extended properties, it does not describe the MS_Description property.

How SQLHelp uses Extended Properties

If you select the "Use enterprise manager descriptions" SQL option, SQLHelp will make use of the MS_Description extended property, if it finds one.  This can provide for a common location to store your object descriptions, assuming you are using SQL Server 2000.  If you are using a combination of both SQLHelp tags and extended properties, please note that if both are defined for a given object or object attribute, the descriptions from each will be used, with the SQLHelp tags appearing first.

Where Extended Properties Fail

As good as the new extended properties are for documenting SQL elements, they do have some current limitations.  For example, there is no mechanism to describe the columns in a result set, nor return values.  As such, any complete database documentation solution will need to have a combination of both SQLHelp tags and the MS_Description extended properties.  

Additionally, if you are desiring to compose long descriptions for certain objects (e.g. a complete usage guideline for a critical stored procedure), extended properties may not be appropriate.  This stems from the use of the SQL Server 2000 data type of sql_variant which has a maximum length of 8016 bytes (or approximately 4000 UNICODE characters).

Even with these limitations, use of the MS_Description extended property can go a long way towards creating self documented databases.

© 2001-2004 Pikauba Software. All rights reserved.