Documenting databases is fun again!
No, not really. But a least it's not a complete waste of time. Unlike those data documents you've written in the past, this one lives with your database (in SQL Server Extended Properties) so it stays up to date. Follow along and we'll show you
how easy it is to create useful documentation for that good old Northwind database...
Make a connection
The first step is to connect to a database. You can enter a connection string or click on the "..." button to view the standard data connection dialog.
Hit the ground running - get advanced!
You can breeze right by the next tab (Advanced Settings) if you'd like, but it's got some neat gizmos that could save you some time. The two big features:
- Auto-Fill - this looks at you schema and adds descriptions for primary and foreign keys. You can customize the text these use.
- Additional Properties - By default, you're only filling in a simple "Description" tab. If you'd like add other columns to your documentation, you're going to want to look at Additional Properties.
Document that DB
This is where the rubber meets the road. You're going to need to fill this out, but we've made it a lot easier for you:
- The user interface shows you column names and datatypes to help you remember what all those columns are used for.
- The datagrid lets you move around pretty quickly
- Your work is saved immediately, so you can work on it as time permits. Your edits are saved with the database.
Now that you've documented your database, you can export it to share with others. There are two ways to share it:
- Documentation formats (Word, Excel, HTML)
- Importable formats (T-SQL, XML) - these let other users import your documentation into their copy of the database
Here's what the export looks like in Excel. Note that the Table and Column documentation are on separate worksheets. Feel free to pick your favorite AutoFormat to pretty this up.
Here's the HTML export:
The next two formats are importable. The T-SQL export can be executed via Query Analyzer / SSMS, or it can be loaded by DDC.
Here's the XML format. The only reasons you'd want to use this are to import into another copy of the database via DDC, or to export to another format. All file exports actually start with XML and go through an XSL transform. You can check out the XSL
folder and modify any of these, or create your own.
Copy that documentation with Import
You can use the Import tab to load previously exported documentation. Browser for a T-SQL or XML export from DDC. We do a few checks to make sure the file was created by DDC, then load the documentation into the currently connected database.