[%R% [N]]%.q:COMMENT%,
[%R% [N]]'user', [%R% [N]]@CurrentUser, [%R% [N]]'table', [%R% [N]]%.q:TABLE%
]
---------------------------------ColumnComment-----------------------------
[if exists (select 1
from sys.extended_properties
where major_id= object_id('[%QUALIFIER%]%TABLE%')
and value = [%R% [N]]%.q:COMMENT%)
begin
[%OWNER% [.O:[execute ][exec ]]sp_dropextendedproperty [%R% [N]]'MS_Description',
[%R% [N]]'user', [%R% [N]]%.q:OWNER%, [%R% [N]]'table', [%R% [N]]%.q:TABLE%, [%R% [N]]'column', [%R% [N]]%.q:COLUMN%
:declare @CurrentUser sysname
select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_dropextendedproperty [%R% [N]]'MS_Description',
]
end
][%OWNER% [.O:[execute ][exec ]]sp_addextendedproperty [%R% [N]]'MS_Description',
[%R% [N]]%.q:COMMENT%,
[%R% [N]]'user', [%R% [N]]%.q:OWNER%, [%R% [N]]'table', [%R% [N]]%.q:TABLE%, [%R% [N]]'column', [%R% [N]]%.q:COLUMN%
:select @CurrentUser = user_name()
[.O:[execute ][exec ]]sp_addextendedproperty [%R% [N]]'MS_Description',
[%R% [N]]%.q:COMMENT%,
[%R% [N]]'user', [%R% [N]]@CurrentUser, [%R% [N]]'table', [%R% [N]]%.q:TABLE%, [%R% [N]]'column', [%R% [N]]%.q:COLUMN%
]