Automatically Generate MediaWiki Documentation of MS SQL Database

I previously published a couple of posts on generating Wiki documentation in dbscript, and the current release 0.93 of dbscript puts all the steps together to automatically generate MediaWiki documentation of an MS SQL Server database schema, and values of selected tables.

This is an example of how to generate documentation for the AdventureWorks sample database. You need:

  • dbscript 0.93 or later installed
  • AdventureWorks installed
  • a MediaWiki installation with a user in the Bot group

In dbscript, create a Project AdventureWorks. Add a Database with dbo login credentials, and press Test Connection to mark the database connectable. (Alternatively, you can script the AdventureWorks database in Management Studio, and upload the generated sql file)

The Documentation Generator needs to handle tables differently from other database objects, as it needs to apply different XSL style sheets to the schema information.

Thus we create an Object Selection which selects every object except of tables: create an Object Selection “everything except tables”, and click the Objects page. Add Object Type “Table” with the option “Select included objects” selected. Add all other available object types with the “Select excluded objects” option.

Create a Documentation Generator, and select type “MediaWiki” (currently the only available option). Select the newly created Project Version. Enter the Wiki’s URL (, a section name (optional), the wiki bot’s username and its password.

If no section name is given, the whole page for each database object will be replaced. If you specify a section name, only this section is created or changed.

Next, go to the Parts page.

Under “New Part”, select “Project Version” and click Create. Enter a sequence number (e.g. 100), select an XSL (MediaWiki ProjectVersion overview), and a Page Title (“AdventureWorks Overview”) and save. This will create a summary page.

Go to the Parts page again, select New Part “Object”, click Create. Now we add tables to the documentation. Enter a sequence number (200), select an XSL (MediaWiki Table DocGen), and an Object Type “Table”.

Now we add all database objects other than tables: On the Parts page, select “Object”, click Create. Enter sequence number (300), select XSL (MediaWiki SourceCode DocGen), and specify Object Select “everything except tables”.

Go to the Generate page. Press the Generate button, and watch the progress log for error messages or progress updates.

The results of the documentation generator can be viewed here. dbscript is available for download here.

About these ads

5 Responses to Automatically Generate MediaWiki Documentation of MS SQL Database

  1. [...] MediaWiki Documentation of MS SQL Database Values This is part 2 of the description of automating MediaWiki documentation using dbscript, and deals with documenting table [...]

  2. [...] HTML Documentation of MS SQL Database In previous posts I described how to generate MediaWiki documentation of an MS SQL database schema and selected table data using [...]

  3. [...] steps to setup the documentation generator are essentially the same as described here and here for MediaWiki wikis, except that the respective ScrewTurn alternatives (generator type, [...]

  4. Paul Aviles says:

    Can it be run on a linux mediawiki installation targeting an MS SQL server or in that case mediawiki needs to run under Windows?



  5. devio says:


    my demo site actually runs MediaWiki on Ubuntu Linux. So: Yes!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 66 other followers

%d bloggers like this: