Sql Server 給表及字段添加註釋
阿新 • • 發佈:2017-10-03
base dex es2017 pex 添加 @value logs table images
一、table
1、添加表註釋
EXECUTE sys.sp_addextendedproperty @name = N‘MS_Description‘, -- sysname @value = N‘字典組表‘, -- sql_variant @level0type = N‘user‘, -- varchar(128) @level0name = N‘base‘, -- sysname schema @level1type = N‘table‘, -- varchar(128) @level1name = N‘tblDictionaryGroup‘, -- sysname @level2type = NULL, -- varchar(128) @level2name = NULL -- sysname
2、修改表註釋
EXECUTE sys.sp_updateextendedproperty @name = N‘MS_Description‘, -- sysname @value = N‘字典組表1‘, -- sql_variant @level0type = N‘user‘, -- varchar(128) @level0name = N‘base‘, -- sysname schema @level1type= N‘table‘, -- varchar(128) @level1name = N‘tblDictionaryGroup‘, -- sysname @level2type = NULL, -- varchar(128) @level2name = NULL -- sysname
3、刪除表註釋
EXECUTE sys.sp_dropextendedproperty @name = N‘MS_Description‘, -- sysname @level0type = N‘user‘, -- varchar(128) @level0name= N‘base‘, -- sysname schema @level1type = N‘table‘, -- varchar(128) @level1name = N‘tblDictionaryGroup‘, -- sysname @level2type = NULL, -- varchar(128) @level2name = NULL -- sysname
二、Column
1、添加字段註釋
Sql Server 給表及字段添加註釋