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