views:

51

answers:

3

We have a fairly large database (in SQL Server 2008) with many tables. We have just bought Red Gate's SQL Doc for documentation purposes. We would like to document this database in a detailed way. What is the best practice in documenting a database? How do you document your attributes with definitions? SQL Doc documents the database nicely but how to add attribute definitions to this document (is there some automagigal way)?

+2  A: 

We use extended properties to "tag" constraints, tables, indexes, viws, procs, the lot. (we also use SQL doc)

It's mentioned on the interweb quite a lot too

gbn
We do the same.
Chris Lively
The MS_Description extended property is the one you're looking for. You can add these to your database either via SSMS (Properties on an object) or via the Preview pane in SQL Doc.
David Atkinson
A: 

I don't know of any automatic ways of doing this, it's a bit tedious, but worth it. There are a few ways to do this, one through the table designer (right clicking on a table, and choosing "design") and entering text into the "Description" property on each column, or you can also use the Database Diagramming Tool as described here:

http://devtoolshed.com/content/sql-create-table-add-description-column

JasonA
This is extended properties but via the GUI
gbn
A: 

You should check out this question on how to add a description to a column. http://stackoverflow.com/q/3754180/444443

This way when you run your update scripts you can add descriptions to columns or tables with the extended properties that GBN mentioned

EJC