解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysproperties无效的问题
来源:互联网 发布:濮阳交通违章查询软件 编辑:程序博客网 时间:2024/05/15 04:53
在PowerDesigner 16 中生成的sql语句,在执行的时候报错:对象名sysproperties 无效的错误;造成此问题的原因是由于Sql 2005、2008 删除了系统表 sysproperties 而改用 sys.extended_properties 表所致 , 以下是通过创建sysproperties视图,以及修改powerdesigner sql语句生成模板后,
再生成数据库SQL脚本执行,共分为三部:
再生成数据库SQL脚本执行,共分为三部:
第一步:在Sql 2005/2008 Exec the Sql 创建View 'sysproperties'
if exists (select 1 from sysobjects where name = 'sysproperties'and xtype = 'V')begin DROP VIEW syspropertiesend GO CREATE VIEW sysproperties AS SELECT A.name As TableName, A.id As TableID,B.Name As ColName,B.colid As ColID, B.xtype As ColType,C.name As PropName,C.Value As PropValue FROM sysobjects As A INNER JOIN syscolumns As B ON A.id = B.id INNER JOIN sys.extended_properties As C ON C.major_id = A.id AND ( minor_id = B.colid)
第二 步: 修改Table TableComment模板 路径是 Database -> Edit Current DBMS 窗体 General 选项卡 下 Script -> Objects -> Table -> TableComment
[if exists (select 1 from sys.extended_properties where major_id = object_id('[%QUALIFIER%]%TABLE%') and minor_id = 0 and name = 'MS_Description') 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% :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% ] 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% :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% ]第三步:修改Column ColumnComment模板 路径是 Database -> Edit Current DBMS 窗体 General 选项卡 下 Script -> Objects -> Column -> ColumnComment
[if exists (select 1from syspropertieswhere TableID = object_id('[%QUALIFIER%]%TABLE%')and ColName = %.q:COLUMN% AND PropName='MS_Description')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 sysnameselect @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%]修改之后 使用Generate Database 生成的SQL便可在SQL 2005/2008下执行 不在报找不到sysproperties 的错误。
0 0
- 解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysproperties无效的问题
- 解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysproperties无效的问题
- 解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysproperties无效的问题
- 解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysproperties无效的问题
- 解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysproperties无效的问题
- 解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysproperties无效的问题
- 解决PowerDesigner 16 Generate Datebase For Sql2005 找不到sysproperties表的问题
- 解决PowerDesigner 16 Generate Datebase For Sql2005 找不到sysproperties表的问题
- 解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysprop
- PD16 Generate Datebase For Sql2008R2时报脚本错误“对象名sysproperties无效”
- 解决方案:PowerDesigner 16生成的SqlServer 2000/2005/2008脚本执行出现:“对象名sysproperties无效”
- 解决PowerDesigner 生成Sql2005-2012 找不到sysproperties表的问题
- PowerDesigner 16 sql server 2008 生成备注报“对象名 'sysproperties' 无效”解决办法。
- PowerDesigner 16 sql server 2008 生成脚本时备注报“对象名 'sysproperties' 无效”解决办法
- 对象名 'sysproperties' 无效
- SQL2005中 sysproperties 无效
- SQL2000的系统表sysproperties在SQL2005中 无效的 问题
- SQL2000的系统表sysproperties在SQL2005中 无效的问题
- Delphi的正则官方单元
- springMVC注解@initbinder
- IOS 唤醒另一个APP(app之间互相通信)
- 黑马程序员——-IOS学习五:UITabBarController初步-——黑马 ios 技术博客
- 移动设备App测试总结
- 解决PowerDesigner 16 Generate Datebase For Sql2005/2008 对象名sysproperties无效的问题
- ubuntu server下同时执行多个任务 万能的screen
- javaScript学习笔记1
- 堆和栈的区别
- 扩展卡尔曼滤波的实现
- IOS 静态库合并
- shell脚本程序中的部分常用环境变量和参数变量的说明以及简单shell脚本示例
- Android: remove appcompat_v7 and create library project
- iOS_静态库合并