How to give Descriptions for the Columns in the table?

  • Hi,

    Is there any way to give the Descriptions for the columns while creating the SQL table?

    Thanks in Advance

  • if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'EMPLOYEE', 'column', 'EMP_NUM'))

    BEGIN

    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'EMPLOYEE', 'column', 'EMP_NUM'

    END

    exec sys.sp_addextendedproperty 'MS_Description', 'DESCRIPTION OF THE COLUMN.', 'schema', 'dbo', 'table', 'EMPLOYEE', 'column', 'EMP_NUM'

    go

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

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