Dear all,
How do I such thing? I've got a table with 140 columns and I should need to
introduce a comment. Is there any programatically way for that?
I know that ORACLE uses COMMENT ON <FIELD>...
Thanks for any help,
EnricCheck out sp_addextendedproperty and fn_listextendedproperty
in BOL.|||Thanks Mark... Any example?
oh my god
"markc600@.hotmail.com" wrote:
> Check out sp_addextendedproperty and fn_listextendedproperty
> in BOL.
>|||create table dbo.sometable(col1 int, col2 int)
-- Add comments per column here
exec sp_addextendedproperty 'MS_Description', 'comments for col1',
'user', dbo, 'table', sometable, 'column', col1
exec sp_addextendedproperty 'MS_Description', 'comments for col2',
'user', dbo, 'table', sometable, 'column', col2
-- These comments will show up in Enterprise Manager as well
select *
from ::fn_listextendedproperty ('MS_Description', 'User','dbo','table',
'sometable', 'column', default)
exec sp_dropextendedproperty 'MS_Description',
'user', dbo, 'table', sometable, 'column', col1
exec sp_dropextendedproperty 'MS_Description',
'user', dbo, 'table', sometable, 'column', col2|||Thanks again for that.
Regards,
"markc600@.hotmail.com" wrote:
> create table dbo.sometable(col1 int, col2 int)
> -- Add comments per column here
> exec sp_addextendedproperty 'MS_Description', 'comments for col1',
> 'user', dbo, 'table', sometable, 'column', col1
> exec sp_addextendedproperty 'MS_Description', 'comments for col2',
> 'user', dbo, 'table', sometable, 'column', col2
>
> -- These comments will show up in Enterprise Manager as well
> select *
> from ::fn_listextendedproperty ('MS_Description', 'User','dbo','table',
> 'sometable', 'column', default)
>
> exec sp_dropextendedproperty 'MS_Description',
> 'user', dbo, 'table', sometable, 'column', col1
> exec sp_dropextendedproperty 'MS_Description',
> 'user', dbo, 'table', sometable, 'column', col2
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment