Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I created a db in sql server 2008 and I wrote for some columns description to describe them, What I want now is to find a way to export these tables design including the description for each column into a document to be able to discuss with the teams and be printed.

share|improve this question
Previously: stackoverflow.com/questions/887370/… – Valkyrie Dec 7 '11 at 15:20

2 Answers

I used the following recently as the first step of a full DB audit. I know there are additional fields in COLUMNS and TABLES.

    SELECT
        TABLES.TABLE_SCHEMA + '.' + TABLES.TABLE_NAME 'TABLE_NAME',
        COLUMNS.COLUMN_NAME,
        COLUMNS.DATA_TYPE,
        COLUMNS.CHARACTER_MAXIMUM_LENGTH
    FROM 
        INFORMATION_SCHEMA.COLUMNS,
        INFORMATION_SCHEMA.TABLES
    WHERE
        COLUMNS.TABLE_NAME = TABLES.TABLE_NAME
        AND TABLES.TABLE_SCHEMA = 'MySchema'
    ORDER BY
        TABLES.TABLE_SCHEMA,
        TABLES.TABLE_NAME,
        COLUMNS.COLUMN_NAME
share|improve this answer

The simplest solution is to buy something like Red-Gate's SQL Doc. There are a few people who have written scripts that you can find for free.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.