SQLTeam.com | Weblogs | Forums

Try to use SP_addextendedproperty


I have tryed to get sp_addextendedproperty to work on a number of different servers and databases, but while it does not error it does nothing either. It should show the description in the design description area; but again I ma not getting it like the instructions show on Books Online says.
Any ideas what I could be doing wrong?

Preformatted text
EXEC sp_addextendedproperty
@name = N'Ms Diceriotion2',
@value = 'This is the Miser Account number.',
@level0type = N'Schema', @level0name = 'dbo',
@level1type = N'Table', @level1name = 'Not In VPData',
@level2type = N'Column', @level2name = 'acct_nbr';
Preformatted text


Here's what I use for the Description on a Column (is that what you are trying to do?)

DECLARE @v sql_variant 
SET @v = N'This is my description'
EXECUTE sp_addextendedproperty 
          @name  = N'MS_Description', 
          @value = @v, 
          @level0type = N'SCHEMA', 
          @level0name  = N'dbo', 
          @level1type = N'TABLE', 
          @level1name = N'MyTableName', 
          @level2type = N'COLUMN', 
          @level2name = N'MyColumnName'

Is [Not In VPData] your actual, exactly matching, table name?


Thanks that worked, I wonder why BOL doesn't show it this way,
Anyway thanks I really appreciate it.


I think the only thing different in your version is the @name parameter - could that be it? (capitalisation of some of the other parameters will be an issue if your database is case sensitive)