温馨提示×

sqlserver修改表结构字段怎么加注释

小亿
85
2024-05-25 19:34:09
栏目: 云计算

在SQL Server中,可以使用以下语法来为表结构字段添加注释:

EXEC sys.sp_addextendedproperty 
    @name = N'MS_Description', 
    @value = N'Your comment here',
    @level0type = N'Schema', 
    @level0name = 'dbo', 
    @level1type = N'Table', 
    @level1name = 'YourTableName', 
    @level2type = N'Column', 
    @level2name = 'YourColumnName';

请将上面的语法中的以下部分替换为实际的值:

  • Your comment here:要添加的注释内容
  • YourTableName:表名
  • YourColumnName:字段名

执行上面的语法后,即可为指定的表结构字段添加注释。

0