SQL Server DB documentation from schema

I am in the (fun!) process of documenting an application I created nearly 5 years ago, in which the majority of the functionality is controlled by the database (it's a business workflow automation tool).

Reverse engineering substantially reduces the size of the task - Visio's Database > Reverse Engineer... command is a real time saver when you have foreign key constraints defined, makes generation of an ERD no more complicated than arranging all the boxes so that none (or few!) of the relationship lines cross!

A little utility contributed to the Code Project website makes the process of creating table and field documentation much easier: http://www.codeproject.com/KB/database/sqldoc.aspx

This utility can be pointed at a SQL server database, and will generate an HTML document listing all the tables and fields in the database, together with data types, nullable, default values and description fields from the db schema.

It uses an XSLT transformation to convert the xml generated to an HTML document. This can be edited so that it's closer to final requirements - I have updated the XSLT to place anchors on each table name, and links at the top of the file to each table.

This makes it a much less arduous task to document each table and field - I can edit the file in dreamweaver and just add descriptions for each field and table.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Andrew Penhorwood's Gravatar I wrote a similar utility to what you are describing in CFML and SQL. My routine meshes up any needed data with the fields so I have current documentation all in one place.
# Posted By Andrew Penhorwood | 12/05/09 03:51
Dan Lancelot's Gravatar Hi Andrew,

That sounds useful :)

It would also be possible to use something like Brian Rinaldi's Illudium PU-36 Code Generator (http://cfcgenerator.riaforge.org/) to produce HTML documentation...
# Posted By Dan Lancelot | 12/05/09 09:22
Kola's Gravatar Cheers for this Dan that will come in useful
# Posted By Kola | 29/05/09 14:16
BlogCFC was created by Raymond Camden. This blog is hosted by DotLance Ltd.