Home Products Downloads Purchase Support News Members Company
SITE FEED
Support Forum
The fastest and most effective to get answers to your questions quickly. Click Here for more info.
FAQs
Quick answers to common questions. Click Here for more info.
Troubleshooting
Known issues and basic troubleshooting techniques for problems or unexpected behaviors. Click Here for more info.
Knowledgebase
Technical tips, How-to articles, and other tutorials about ApexSQL Tools. Click Here for more info.
Online Documentation
All of our help files for download or convenient viewing online. Click Here for more info.
Videos
Watch product demos, training videos, or tutorials of our products' main features.  We frequently upload new videos so check often for updates. Click Here for more info.

ApexSQL Knowledgebase

Tips and How-to Articles for Apex SQL Tools


How to put descriptions for the tables in ApexSQL Doc

This KB discusses how to add descriptions to tables in ApexSQL Doc through the extended property feature.

DESCRIPTION
To show the extended properties in your database's documentation , ApexSQL Doc allows you to specify a common name for the properties in the ‘Extended Properties’ step of the Project Wizard. As with Enterprise Manager's Table designer or Management Studio, MS_Description is also the default Main Extended Property Name set by ApexSQL Doc when a user adds extended properties.

SOLUTION
The following example will demonstrate how the Main Extended Property Name value affects the final documentation:

Example 1:

CREATE TABLE [DBO].[TABLE_EXT_PROPS] (
[FIRST_COL] [INT] NOT NULL,
[SECOND_COL] [VARCHAR](50) NULL)
GO
--First property
EXEC SYS.SP_ADDEXTENDEDPROPERTY
@name = N'MS_Description' ,
@value = N'Description for First_col' ,
@level0type = N'SCHEMA' ,
@level0name = N'dbo' ,
@level1type = N'TABLE' ,
@level1name = N'Table_Ext_Props' ,
@level2type = N'COLUMN' ,
@level2name = N'First_col'
GO
--Second property
EXEC SYS.SP_ADDEXTENDEDPROPERTY
@name = N'MS_Description' ,
@value = N'Description for Second_col' ,
@level0type = N'SCHEMA' ,
@level0name = N'dbo' ,
@level1type = N'TABLE' ,
@level1name = N'Table_Ext_Props' ,
@level2type = N'COLUMN' ,
@level2name = N'Second_col'
GO


Above SQL script displays as below in the documentation:



Example 2: Let’s change the name of the first property to another, for example ‘Caption’:


EXEC SYS.SP_UPDATEEXTENDEDPROPERTY
@name = N'Caption' ,
@value = N'Description for First_col' ,
@level0type = N'SCHEMA' ,
@level0name = N'dbo' ,
@level1type = N'TABLE' ,
@level1name = N'Table_Ext_Props' ,
@level2type = N'COLUMN' ,
@level2name = N'First_col'


The second property name stays as “MS_Description”. The same goes for our Main Extended Property Name.

Below image shows how this affects the documentation:



The first property value is gone from the Description column because the property name was changed.

Example 3: Let’s change the value of the Main Extended Property Name to ‘Caption’. This will affect the documentation as below:



The second property disappears because its name remains “MS_Description”.

SEE ALSO
Options : Extended Properties in Documentation

AUTHOR
David Dawson

LAST REVIEW
29 August 2007

Labels:

...


Welcome to the ApexSQL Knowledge Base

Welcome to the ApexSQL Training Knowledge Base. Here you'll find tips, reviews, videos, and articles on how to get the most out of ApexSQL Tools and Microsoft SQL Server.

Labels: , , , , , , , , , , ,

...

© 2008 Apex SQL Tools All Rights Reserved | 1.919.968.8444 | Contact Us | Terms of Use