Microsoft SQL Server:Add Table/Columns Description



Use sys.sp_addextendedproperty to add Description to the tables and columns.

E.g.

For Table Description,


EXEC sys.sp_addextendedproperty
@name = N'MS_Description',
@value = N'Put your Table Comments Here ',
@level0type = N'SCHEMA', @level0name = 'dbo',
@level1type = N'TABLE',  @level1name = 'TableName';
GO


**dbo is database schema.you may your own schema where objects reside.

For Columns Description,

EXEC sys.sp_addextendedproperty
@name=N'MS_Description',
@value=N'Put your Comment here' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TableName',
@level2type=N'COLUMN',@level2name=N'ColumnName1'
GO

EXEC sys.sp_addextendedproperty
@name=N'MS_Description',
@value=N'Put your Comment here' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TableName',
@level2type=N'COLUMN',@level2name=N'ColumnName2'
GO

Comments

Popular posts from this blog

Oracle 12c : How To Purge The UNIFIED AUDIT TRAIL

Oracle 11g: Install Instant Client 11.2.0.3.0 on Linux x86_64 Server.

gDBClone Powerful Database Clone/Snapshot Management Tool (Doc ID 2099214.1)