sqlserver修改表結(jié)構(gòu)字段怎么加注釋

小億
256
2024-05-25 19:34:09
欄目: 云計(jì)算

在SQL Server中,可以使用以下語(yǔ)法來(lái)為表結(jié)構(gòu)字段添加注釋?zhuān)?/p>

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';

請(qǐng)將上面的語(yǔ)法中的以下部分替換為實(shí)際的值:

  • Your comment here:要添加的注釋內(nèi)容
  • YourTableName:表名
  • YourColumnName:字段名

執(zhí)行上面的語(yǔ)法后,即可為指定的表結(jié)構(gòu)字段添加注釋。

0