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

Agent Installation on Windows Server. SQL Server (Failover Cluster) target addition in OEM 12c

Oracle 10g/11g Linux:SMS the alert logs ORA- errors generated in timestamp

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