Q
Problem solve Get help with specific problems with your technologies, process and projects.

Placing and retrieving comments on tables and columns

How can I put comments on tables and columns and retrieve these table and column comments via a store procedure or SQL statement?

If you are using SQL Server 7.0 or earlier, you can't. If you are using SQL Server 2000, you can add comments using the extended properties. You can use the following function to retrieve extended properties.

 From Books Online (c)1988-2000 Microsoft Corporation. All Rights Reserved. fn_listextendedproperty ( { default | [ @name = ] 'property_name' | NULL } , { default | [ @level0type = ] 'level0_object_type' | NULL } , { default | [ @level0name = ] 'level0_object_name' | NULL } , { default | [ @level1type = ] 'level1_object_type' | NULL } , { default | [ @level1name = ] 'level1_object_name' | NULL } , { default | [ @level2type = ] 'level2_object_type' | NULL } , { default | [ @level2name = ] 'level2_object_name' | NULL } )
Books Online will have all of the details and sample code that you need.

 

For More Information

This was last published in February 2002

Dig Deeper on Microsoft SQL Server Installation

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close