adding a column description

后端 未结 4 702
滥情空心
滥情空心 2020-12-13 06:15

Does anyone know how to add a description to a SQL Server column by running a script? I know you can add a description when you create the column using SQL Server Management

4条回答
  •  盖世英雄少女心
    2020-12-13 06:36

    This works for me. Relevant arguments are indicated with little arrows.

    EXEC sys.sp_addextendedproperty 
      @name=N'MS_Description'
     ,@value=N'Here is my description!'  --<<<<
     ,@level0type=N'SCHEMA'
     ,@level0name=N'dbo'
     ,@level1type=N'TABLE'
     ,@level1name=N'TABLE_NAME' --<<<<
     ,@level2type=N'COLUMN'
     ,@level2name=N'FIELD_NAME'  --<<<<
    

提交回复
热议问题