以下示例将标题属性添加到 Address 表中的 PostalCode 列。
USE AdventureWorks2008R2; GO EXEC sp_addextendedproperty @name = N'Caption', @value = 'Postal code is a required column.', @level0type = N'Schema', @level0name = Person, @level1type = N'Table', @level1name = Address, @level2type = N'Column', @level2name = PostalCode; GO
以下示例对 T1
表的 ID
列更新 Caption
属性的值。
USE AdventureWorks2008R2; GO CREATE TABLE T1 (id int , name char (20)); GO EXEC sp_addextendedproperty @name = N'Caption' ,@value = N'Employee ID' ,@level0type = N'Schema', @level0name = dbo ,@level1type = N'Table', @level1name = T1 ,@level2type = N'Column', @level2name = id; GO --Update the extended property. EXEC sp_updateextendedproperty @name = N'Caption' ,@value = 'Employee ID must be unique.' ,@level0type = N'Schema', @level0name = dbo ,@level1type = N'Table', @level1name = T1 ,@level2type = N'Column', @level2name = id; GO