时间:2021-07-01 10:21:17 帮助过:29人阅读
[if exists (select 1
from sysproperties where id = object_id(‘[%QUALIFIER%]%TABLE%‘) and smallid in(select colid from syscolumns where id = object_id(‘[%QUALIFIER%]%TABLE%‘) and name = %.q:COLUMN% and number = 0) and name=‘MS_Description‘ and type = 4 ) begin
最后贴出完整的代码:
[if exists (select 1 from sysproperties where id = object_id(‘[%QUALIFIER%]%TABLE%‘) and smallid in(select colid from syscolumns where id = object_id(‘[%QUALIFIER%]%TABLE%‘) and name = %.q:COLUMN% and number = 0) and name=‘MS_Description‘ and type = 4 ) 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‘, [%R%?[N]]‘user‘, [%R%?[N]]@CurrentUser, [%R%?[N]]‘table‘, [%R%?[N]]%.q:TABLE%, [%R%?[N]]‘column‘, [%R%?[N]]%.q:COLUMN% ] 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% ]
该代码经过测试,暂时没问题。
这是修改位置
PowerDesign 16.0 生成的SQL Server2000 数据库脚本时MS_Description不存在的问题解决
标签:png 默认 nbsp htm edit designer cut ble 1.5