为表或者表字段添加扩展属性(MS_Description、sp_addextendedproperty、注释)
sp_addextendedproperty (Transact-sql) - SQL Server | Microsoft Docs
A.将扩展属性添加到表中
Address 下面的示例将扩展属性添加到 Person 架构中的Address表。
USE AdventureWorks2012; GO EXEC sys.sp_addextendedproperty @name = N'MS_DescriptionExample', @value = N'Street address information for customers, employees, and vendors.', @level0type = N'SCHEMA', @level0name = 'Person', @level1type = N'TABLE', @level1name = 'Address'; GO
B. 将扩展属性添加到表中的列
PostalCode 以下示例将扩展属性添加到Person 架构中 Address表中的PostalCode列。
USE AdventureWorks2012; GO EXEC sp_addextendedproperty @name = N'MS_DescriptionExample', @value = 'Postal code is a required column.', @level0type = N'Schema', @level0name = 'Person', @level1type = N'Table', @level1name = 'Address', @level2type = N'Column', @level2name = 'PostalCode'; GO
posted on 2021-07-09 10:41 springsnow 阅读(314) 评论(0) 收藏 举报

浙公网安备 33010602011771号