标签:
原因:系统函数sp_addextendedproperty 的第3个参数(用户名) 应该是Schema。但PD在生成的时候却是’user’
解决方法
在PDM时。DataBase >> Edit Current DBMS >> Script >> Object >> Column >> ColumnComment
在value 栏中默认值是:
[%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%
:declare @CurrentUser sysname
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%
]
修改为 :
[%OWNER%?[.O:[execute ][exec ]]sp_addextendedproperty [%R%?[N]]‘MS_Description‘,
[%R%?[N]]%.q:COMMENT%,
[%R%?[N]]‘SCHEMA‘, [%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_addextendedproperty [%R%?[N]]‘MS_Description‘,
[%R%?[N]]%.q:COMMENT%,
[%R%?[N]]‘SCHEMA‘, [%R%?[N]]@CurrentUser, [%R%?[N]]‘table‘, [%R%?[N]]%.q:TABLE%, [%R%?[N]]‘column‘, [%R%?[N]]%.q:COLUMN%
]
红色部分为修改部分
PowerDesigner15.1给自定义架构表字段添加MS_Description出错
标签:
原文地址:http://www.cnblogs.com/Impulse/p/5601504.html