• We currently have data dictionaries for much of our data warehouse, but as we build new tables (and corresponding data dictionaries) this will be helpful. Thanks for the procedure!

    My minor modifications for 2005 were to set values (instead of default):

    declare @DBName varchar (20)

    Set @DBName = PARSENAME (@TableName, 3)

    declare @TableSchema varchar (20)

    Set @TableSchema = PARSENAME (@TableName, 2)

    set @TableName = PARSENAME (@TableName, 1)

    if @DBName is not null

    and @DBName != DB_NAME()

    begin

    print 'Cannot run this on DB ''' + @DBName + '''. Must be run on current DB.'

    return;

    end

    -- Set up some values for displaying the results.

    declare @Y varchar (10)

    Set @Y= ' y'; -- Spacing is for nicer look.

    declare @Empty varchar (1)

    Set @Empty = '';

    I've sent it to the rest of my team and will let you know what they think of it 🙂