The questions really says it all, Is it possible to update an extended property of a column in a table. I have been looking around online but they only seem to show updating the extended property for a table and not the columns in a table.
Extended properties are a series of properties stored in property sets, which can be saved as part of an object in the metadata. These properties act as placeholders that allow you to store values on different objects.
Create Sample Extended Properties To enter an extended property in SSMS, right click on a database and select Properties. On the Database Properties window go to Extended Events and add a new property.
Right click on Table/View in Object Explorer, select Properties. Select Extended Properties from the pane on the left. Select the extended properties and click Delete at the bottom right of the window.
EXECUTE sp_updateextendedproperty
N'MS_Description',
@v,
N'SCHEMA', N'dbo',
N'TABLE', N'Table_1',
N'COLUMN', N'i'
It's actually the very first sample in MSDN topic:
http://technet.microsoft.com/en-us/library/ms186885.aspx
Here's a more complete sample:
--Add extended property
EXEC sp_addextendedproperty
@name = N'Question1'
,@value = N'Hello'
,@level0type = N'Schema', @level0name = dbo
,@level1type = N'Table', @level1name = Acceptance
,@level2type = N'Column', @level2name = P101;
GO
--Verify
SELECT * FROM fn_listextendedproperty
(NULL, 'schema', 'dbo', 'table', 'Acceptance', 'column', 'P101');
GO
--Update the extended property.
EXEC sp_updateextendedproperty
@name = N'Question1'
,@value = N'Hello, What is your name'
,@level0type = N'Schema', @level0name = dbo
,@level1type = N'Table', @level1name = Acceptance
,@level2type = N'Column', @level2name = P101;
GO
--Verify
SELECT * FROM fn_listextendedproperty
(NULL, 'schema', 'dbo', 'table', 'Acceptance', 'column', 'P101');
GO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With