Click here to Skip to main content
12,622,291 members (34,584 online)
Click here to Skip to main content
Add your own
alternative version

Stats

52.5K views
1.4K downloads
17 bookmarked
Posted

Generating Data Dictionary or Database Design Document using MS Word Macros

, 31 Mar 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
Generating Data Dictionary or Database Design Document using MS Word Macros
This is an old version of the currently published article.

Introduction

Manually preparing data dictionary document will take ages in MS Word which contains 100's of tables, stored procedures, functions, triggers, views, indexes, etc. in the SQL Server database as you need to type each and every column of the table along with the associated dependencies. I need a data dictionary document which generates the database schema automatically in one click with nicely formatted. For this I did lot of research in Google to find the solution and finally I have wrote my own code to do this functionality and i thought to share my experience with you all.

The main purpose of this article is to generate the data dictionary document automatically by simply running the macro code in MS Word with in seconds.

I am not a guru of VBA but still started doing some kind of researching on VBA code in Google then I got ideas from different forums and many thanks to those people who posted their ideas.

I hope this solution will help you to prepare the data dictionary document. Here we start...

Basically, this code will prepare you the following information in the document

Table name with the following dependent information.

· Table Column Details
· Indexes
· Views
· Stored Procedures
· Functions
· Triggers
· Primary Keys
· Foreign Keys
· Default Constraints
· Identity Columns

Using the code

Following are the steps to run this code:

1. Simply open a blank word document (it is mandatory).

2. Go to menu Tools->Macro->Macros->Create then this will create a new visual basic module editor.

3. Paste this code.

4. Change the connection string as per your SQL Server credentials (it is mandatory).

5. Add the references of Microsoft Active X Data Objects Library from the menu Tools->References

6. Run the macro by pressing F5 from VBA editor.

Document_Template.JPG

Points of Interest

This code will generate the data dictionary document automatically with one click and it is simple to use this code.

History

Keep a running update of any changes or improvements you've made here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shashidhar Rao Nellutla
Software Developer (Senior)
United Kingdom United Kingdom
Completed Masters in Computer Applications.

You may also be interested in...

Pro
Pro

Comments and Discussions


Discussions posted for the Published version of this article. Posting a message here will take you to the publicly available article in order to continue your conversation in public.
 
Questionit works but it did not get stored procedures Pin
Member 1198044513-Sep-15 6:34
memberMember 1198044513-Sep-15 6:34 
QuestionI modified a Pk problem, i ran this in SQL Server 2014 and Works ok. Pin
Pavel Flores29-Jul-15 15:53
memberPavel Flores29-Jul-15 15:53 
QuestionEdit macro for Description it's not coming in Origiranl Pin
Member 111947325-Nov-14 3:14
memberMember 111947325-Nov-14 3:14 
QuestionNeed this for a oracle database Pin
Member 1048363723-Dec-13 4:02
memberMember 1048363723-Dec-13 4:02 
Questionvery nice tool Pin
harsh.programmer22-Feb-12 1:35
memberharsh.programmer22-Feb-12 1:35 
Questionfor non VB developers Pin
Member 852727129-Dec-11 20:07
memberMember 852727129-Dec-11 20:07 
GeneralThanks Pin
sreelekhamenon8-Dec-10 15:07
membersreelekhamenon8-Dec-10 15:07 
Generalthanks Pin
velpetit9-Dec-09 19:06
membervelpetit9-Dec-09 19:06 
Generalole db Pin
Svetlana Tipping18-Feb-09 23:38
memberSvetlana Tipping18-Feb-09 23:38 
GeneralWord 2007 Pin
Member 217100917-Jun-08 9:09
memberMember 217100917-Jun-08 9:09 
GeneralMacro not working Pin
niranjan singh14-Apr-08 4:15
memberniranjan singh14-Apr-08 4:15 
GeneralRe: Macro not working Pin
grom_boy15-Apr-08 0:36
membergrom_boy15-Apr-08 0:36 
GeneralRe: Macro not working [modified] Pin
AndrewGail24-Apr-08 6:12
memberAndrewGail24-Apr-08 6:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.161128.1 | Last Updated 31 Mar 2008
Article Copyright 2008 by Shashidhar Rao Nellutla
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid