转自: http://www.maomao365.com/?p=8919

摘要:
下文讲述使用sql脚本对数据表或数据列添加注释(备注说明)的方法分享,如下所示:
实验环境:sql server 2008 r2  
实现思路:
使用系统存储过程sys.sp_addextendedproperty对表和列的相关属性进行设置,达到为数据表或数据列添加注释的目的

--数据表添加注释的方法分享
EXEC sys.sp_addextendedproperty @name = N'MS_Description',
@value = N'数据表注释说明', @level0type = N'SCHEMA',
@level0name = N'dbo', @level1type = N'TABLE',
@level1name = N'数据表名称'

--数据字段添加注释的方法分享
EXEC sys.sp_addextendedproperty @name = N'MS_Description',
@value = N'数据列注释说明', @level0type = N'SCHEMA',
@level0name = N'dbo', @level1type = N'TABLE',
@level1name = N'数据表名称', @level2type = N'COLUMN',
@level2name = N'字段名'

 

相关文章:

  • 2022-12-23
  • 2021-10-19
  • 2021-09-01
  • 2022-12-23
  • 2021-09-30
  • 2021-04-24
  • 2021-07-07
猜你喜欢
  • 2021-12-18
  • 2021-10-29
  • 2022-02-25
  • 2021-07-13
  • 2021-10-22
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案