Click here to Skip to main content
Licence CPOL
First Posted 3 Feb 2008
Views 104,920
Downloads 25,034
Bookmarked 97 times

Document SQL Server 2000/2005 Database

By | 17 Oct 2009 | Article
T-SQL script to generate the document of SQL 2000/2005 database
 
Part of The SQL Zone sponsored by
See Also

Introduction

Here is the script to generate the HTML document of your SQL Server 2000/2005 database. It is reverse engineering after the database is created. I hope it will be useful to many of you.

Background

While working as a part time DBA for some projects, I encountered difficulties in documenting and publishing my databases because I do not have any tool available to generate the document. I have written this script that gives the output in HTML that is easy to be modified/published/distributed.

Using the Code

Follow these steps to use this script:

  • Download the attached script file and open it in Management Studio (tested on version 9.00).
  • Select the database for which you want to generate document.
  • Select Result to File (Ctrl+Shift+F) from Query - Results To menu.
  • Execute (F5) the script.
  • In the Save Result dialogue box, type a file name (filename.htm/filename.html) in the File Name text box and select All Files (*.*) in Save As Type dropdown.
  • After successful execution of query, check the output file.

Note: For populating the description of table and columns, update the Description property of table and columns while creating database diagram or add extended property for them with name as MS_Description.

I hope this information will be helpful. I am planning to provide details of code in my next update.

Updates

  • Bug in getting index column is resolved
  • Bug in getting check constraints list is resolved
  • Definition of check constraints is added to document
  • Table Summary is changed to Table Description
  • Table and column description is populated from extended property

Download documentation application from here.

License

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

About the Author

Nitinpatel

Database Developer
Dillistone System
United Kingdom United Kingdom

Member

With 6 years of experience of working on Microsoft platform, currently I am working as Database expert.
 
My skill set includes
-SQL Server 2000/2005/2008
-.Net 2.0/3.5
-ASP/ASP.Net
-Winforms
-C#,VB.Net
-XML, HTML
-Microsoft CRM

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 Pinmemberformthis.com9:07 10 May '12  
GeneralMy vote of 5 PinmemberG.Suman Babu4:06 20 Apr '12  
QuestionVery good Article PinmemberG.Suman Babu4:05 20 Apr '12  
QuestionExcellent script Pinmembermickegus20:35 9 Feb '12  
QuestionGreat job! PinmemberPiotrZajac8:08 5 Feb '12  
GeneralMy vote of 5 PinmemberCassnat12:28 14 Dec '11  
QuestionFlippin Cool! PinmemberStewStyle23:06 12 Dec '11  
GeneralMy vote of 5 PinmemberBastiaans0:17 1 Jun '11  
General[My vote of 1] Thanks PinmemberMamun Reza18:44 30 May '11  
GeneralThanks! Pinmemberbougie3:45 4 May '11  
GeneralThanks PinmemberNayan S. Patel15:53 27 Apr '11  
GeneralMy vote of 5 Pinmemberkiran.puchakayala18:18 22 Apr '11  
GeneralThank you!! PinmemberMember 76655955:39 11 Feb '11  
GeneralThank you PinmembersamirMistry20:39 18 Oct '10  
GeneralThank you very much! .good job Pinmemberkoke170:40 1 Oct '10  
GeneralVery good work (PERFECT!!!) PinmemberAlbric23:47 2 Sep '10  
GeneralMy vote of 5 Pinmemberaivanq015:31 2 Sep '10  
GeneralAwesome script Pinmemberaivanq015:30 2 Sep '10  
GeneralMy vote of 4 PinmemberNArgade23:53 22 Aug '10  
GeneralThank You Pinmembersilverscouts15:24 9 Apr '10  
GeneralExcelent time saver [modified] Pinmemberadesilva@bigw.com.au10:58 17 Feb '10  
GeneralAwesome! Just what I was looking for! Thanks! Pinmembermiguelguzman4:07 16 Feb '10  
GeneralVersion en Español con Procedimientos Almacenados para SQL Srv 2005 PinmemberRonald Fallas Rojas9:49 17 Dec '09  
GeneralRe: Version en Español con Procedimientos Almacenados para SQL Srv 2005 PinmemberRonald Fallas Rojas10:32 17 Dec '09  
QuestionAdd code for table-valued and scalar functions, and stored procedures? PinmemberTechVsLife17:06 21 Nov '09  

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

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 17 Oct 2009
Article Copyright 2008 by Nitinpatel
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid