Automatically Generate 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 data.

First, we need to specify which tables are to be documented: Go to the Project’s Value Scripts menu item, click New, select Script Type “XML”, enter an identifier for the script, and press Insert.

Next, go to the Tables item of the new Value Script. Select a table from the dropdown at the bottom of the page, and select Script Mode “Field Elements” (default).

I included the following tables of AdventureWorks in the documentation:

AddressType, AWBuildVersion, ContactType, CountryRegion, Culture, Currency, Location, SalesReason, SalesTerritory, ScrapReason, Shift, ShipMethod, UnitMeasure.

After you added the desired tables, they are displayed in the list Tables. Click each table name, and then its Columns menu.

From the Column dropdown, select the columns you want to add in your documentation, or press Insert All to include all columns. Columns can be deleted from the list by clicking Delete.

As the Value Script definition is complete, navigate to the Documentation Generator created in the previous post, and display its Parts page.

Under New Part, select Value Script, and click Create.

Enter a Sequence number, select an XSL (default “MediaWiki ValueScript DocGen”), select the newly created value script, and the database you imported the AdventureWorks schema from.

Specify an Alternate Page Section (e.g. “wikivalues”) to avoid overwriting the table definition in the default Page Section. Click Insert.

In the Documentation Generators menu click Generate, and generate the whole documentation, or just the newly created Part containing the data values.

Select the tables listed above to view data documentation samples on this project overview page. dbscript is available for download here.

1 thought on “Automatically Generate MediaWiki Documentation of MS SQL Database Values

  1. Pingback: Generate ScrewTurn Documentation of MS SQL Database and Values « devioblog

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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.