1 PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法如下,

依次打开Tools -- Execute Commands -- Run Script,运行以下脚本:

Option Explicit
ValidationMode = True
InteractiveMode = im_Batch Dim mdl 'the current model 'get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model."
Else
ProcessFolder mdl
End If 'This routine copy name into code for each table, each column and each view
'of the current folder
Private sub ProcessFolder(folder)
Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
tab.comment = tab.name
Dim col 'running column
for each col in tab.columns
col.comment= col.name
next
end if
next Dim view 'running view
for each view in folder.Views
if not view.isShortcut then
view.comment = view.name
end if
next 'go into the sub-packages
Dim f 'running folder
For Each f In folder.Packages
if not f.IsShortcut then
ProcessFolder f
end if
Next
end sub

2 PowerDesigner的数据库逆向工程将中将comment列脚本赋值到name列

打开Tools -- Execute Commands -- Run Script,运行以下脚本:

Option Explicit
ValidationMode = True
InteractiveMode = im_Batch Dim mdl 'the current model 'get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model."
Else
ProcessFolder mdl
End If 'This routine copy name into code for each table, each column and each view
'of the current folder
Private sub ProcessFolder(folder) Dim Tab 'running table
for each Tab in folder.tables
if not tab.isShortcut then
if len(tab.comment) <> then
tab.name = tab.comment
end if
On Error Resume Next
Dim col 'running column
for each col in tab.columns
if len(col.comment) <> then
col.name =col.comment
end if
On Error Resume Next
next
end if
next
end sub

PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法的更多相关文章

  1. 在PowerDesigner中自动生成sqlserver字段备注

    在PowerDesigner中自动生成sqlserver字段备注 PowerDesigner是数据库设计人员常用的设计工具,但其自生默认生成的代码并不会生成sqlserver数据库的字段备注说明.在生 ...

  2. PowerDesigner中SQL文件、数据库表反向生成PDM

    1      反向生成PDM 1)        创建一个空的PDM模型(选择相应的DBMS): 2)        选择[Database]--[Update Model from Database ...

  3. excel 中批量生成mysql的脚本

    一.假设你的表格有A.B.C三列数据,希望导入到你的数据库中表格table,对应的字段分别是col1.col2.col3 二.在你的表格中增加一列,利用excel的公式自动生成sql语句,具体方法如下 ...

  4. Powerdesigner中如何生成测试数据

    设计表完成以后,我们需要生成一些测试数据,可以直接更新到数据库中,下面我们就来试试: 第一步:建立需要的Profiles测试文件,[Model]--[Test Data Profiles],如图所示: ...

  5. PowerDesigner中如何生成主键和自增列

    1.SQL Server版本: 第一步,首先要建立与数据库的连接,方法较多,这里举个例子: http://www.cnblogs.com/netsql/archive/2010/05/17/17375 ...

  6. PowerDesigner中翻转生成PDM图时把Name属性变成注释(转)

    在pd里面运行下面这段代码'******************************************************************************'* File: ...

  7. 使用PowerDesigner生成Access数据库

    PowerDesigner生成Access数据库 自从使用PD以来一直知道可以支持access但一直没有搞明白如何通过脚本来创建access数据表.在PD的tools里终于找到的答案,具体 文件都在C ...

  8. PowerDesigner从安装到同步数据库

    前言 最近项目在如火如荼的进行着4.0版本的数据库设计工作,我们几个后端小伙伴也马不停蹄的进行着数据库的设计.使用的设计软件是PowerDesigner,这里记录一些常见的问题以备日后查看 安装 链接 ...

  9. powerdesigner 生成数据库脚本

    PowerDesigner导出所有SQL脚本 操作:Database=>Generate Database PowerDesigner怎么导出建表sql脚本 1 按照数据库类型,切换数据库. D ...

随机推荐

  1. 总结配置搭建tomcat时碰到的一些小问题

    1.环境变量的配置 在配置tomcat的环境变量时始终配置不对,于是首先检查之前java的环境变量是否正确,发现java命令可以用但是javac却找不到,自己又瞎搞一通,终于javac可以用了,但ja ...

  2. (原+转)ubuntu终端输出彩色文字

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/6066697.html 参考网址: http://www.tuicool.com/articles/jI ...

  3. 【android】android下的junit

    <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPa ...

  4. Identify Smith Numbers

    Link: https://www.hackerrank.com/challenges/identify-smith-numbers def sum_digits(n): return sum(int ...

  5. 了不起的分支和循环03 - 零基础入门学习Python009

    了不起的分支和循环03 让编程改变世界 Change the world by program while循环 说完了分支我们来说说循环,标准的while循环语法我们已经可以熟悉掌握了. 这里我们就简 ...

  6. 选址问题lingo求解

    大家好,我是小鸭酱,博客地址为:http://www.cnblogs.com/xiaoyajiang model : sets : H/h1..h2/:x , y , e ; L/l1..l6/: a ...

  7. 用 C 语言编写 Windows 服务程序的五个步骤

    Windows 服务被设计用于需要在后台运行的应用程序以及实现没有用户交互的任务.为了学习这种控制台应用程序的基础知识,C(不是C++)是最佳选择.本文将建立并实现一个简单的服务程序,其功能是查询系统 ...

  8. TypeError: not enough arguments for format string

    到一个问题,表示100% 的时候,出现这个问题. 因为python语法会认为是你需要转移符,这个时候你可以选择100%% 来表示

  9. Netbeans7.4+Weblogic11g+Spring3.2.4操作JdbcTemplate

    第一步:在Weblgic11g管理界面:http://localhost:7001/console 中建立数据源,我建立的jndi名称为:sjsstjndi 第二步:需要导入spring的以下包:使用 ...

  10. 必须得是一万小时的 刻意训练(deliberate practice)

    成功素质1:一万小时与格物致知 “格物致知14”的概念,我是从张银奎11老师那里了解到的.它的意思是“推究事物的原理,从而获得知识”,跟我在<透过现象看本质 - 写在观看WWDC 2016 Ke ...