describing my columns and the values they will hold

  • hello, was wondering if there is a way to document columns with some descriptions. For example, if i have a column 'Status' in some table, that holds numeric values 0,1,2,3 where 0 means bad, 1 - average, 2 - good, 3 - excellent. i want to document that column in my own words in such a way that every new programmer would understand what the column values mean and what the valid values are. In other words, i am asking is there a way to write some documentation for each column, table, etc? I know there are ways to do it, by using some other lookup table or something like that, but i m wondering if there is any inbuilt support for documenting the columns. thanx for any response.

  • DECLARE @v-2 sql_variant

    SET @v-2 = N'Decsription goes in here'

    EXECUTE sp_addextendedproperty N'MS_Description', @v-2, N'user', N'dbo', N'table', N'TableNameGoesHere', N'column', N'ColumnNameGoesHere'

    Look up sp_addextendedproperty in BOL.

  • thank you, thats exactly wat i was looking for.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply