t-sql

SQL Create Table Add Description to Column

One nice way to build "documentation" directly into your database, you can add extended properties to your tables to describe the columns. This is useful because this data can be displayed in your database diagram.

NOTE: This has only been tested in SQL Server 2005 and 2008.

Normally, to display / manage the descriptions of your columns, you use the SQL Database Diagram tool. Here's what my Database Diagram for my simple database. By default, the "description" field is not displayed.

SQL Script to Create and Update a Database

This script is specific to SQL Server. It uses some syntax that only works in SQL Server (2000,2005,2008). This is a really convenient way to keep your database schema under source control by creating and managing your database in script. Then you can check-in this code as a .SQL file.

Recent comments