About this issue i send you my fix idea
SqlServerSenarist.cs
//when use AddDescription
commands.Add(string.Format( SqlServerResources.AddDescription, (changedObject.DomainObject as IColumn).Description.Replace("'", "''"), (changedObject.DomainObject as IColumn).DBElement.SchemaName, (changedObject.DomainObject as IColumn).DBElement.Name, (changedObject.DomainObject as IColumn).Name));
//when use AlterDescription
commands.Add(string.Format( SqlServerResources.AlterDescription, (change.DomainObject as IColumn).Description.Replace("'", "''"), (change.DomainObject as IColumn).DBElement.SchemaName, (change.DomainObject as IColumn).DBElement.Name, (change.DomainObject as IColumn).Name));
in SqlServerResources.resx i change AlterDescription key for managing also drop
AlterDescription =>
if len('{0}')=0
begin
EXECUTE sp_dropextendedproperty N'MS_Description', N'SCHEMA', N'{1}', N'TABLE', N'{2}', N'COLUMN', N'{3}'
end
else
begin
if ( (select value from ::fn_listextendedproperty ('MS_Description', 'user', 'dbo', 'table', '{2}', 'column', '{3}')) is not null)
begin
EXECUTE sp_updateextendedproperty N'MS_Description', N'{0}', N'SCHEMA', N'{1}', N'TABLE', N'{2}', N'COLUMN', N'{3}'
end
else
begin
EXECUTE sp_addextendedproperty N'MS_Description', N'{0}', N'SCHEMA', N'{1}', N'TABLE', N'{2}', N'COLUMN', N'{3}'
end
end
Regards
|