Applying field descriptions

  • Hi

    I would be grateful if anyone has info on applying the field description in the CREATE TABLE statement. I cannot find any info on how to do this anywhere. I then will use the FN_LISTEXTENDEDPROPERTY to get the information back.

    Thanks, Lorna

     

  • You do it AFTER the Create Table statement

    Like

     
    CREATE   table T1 (id int , name char (20))
     
    EXEC   sp_addextendedproperty 'MS_Description', 'Employee ID', 'user', dbo, 'table', 'T1', 'column', id
    EXEC   sp_addextendedproperty 'MS_Description', 'Employee Name', 'user', dbo, 'table', 'T1', 'column', name
     
    SELECT   *
    FROM   ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', 'T1', 'column', default)


    * Noel

  • Many thanks. I should have spotted that SP!

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

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