网上搜索查阅地址:https://www.2cto.com/database/201704/628659.html

步骤: Powerdesigner中选择Tools----》Excute commands-----》Edit/Run Script

'******************************************************************************
 
'* File: name2comment.vbs
 
'* Purpose: Database generation cannot use object names anymore
 
' in version 7 and above.
 
' It always uses the object codes.
 
'
 
' In case the object codes are not aligned with your
 
' object names in your model, this script will copy
 
' the object Name onto the object Comment for
 
' the Tables and Columns.
 
'
 
'* Title:
 
'* Version: 1.0
 
'* Company: Sybase Inc.
 
'******************************************************************************
 
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 comment 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
 
'把列name和comment合并为comment
 
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

Powerdesigner设计表生成SQL脚本(带有注释)的更多相关文章

  1. PD生成SQL脚本附带注释命令

    '------------------------------------------------------------''脚本功能:' PowerDesigner中批量根据对象的name生成com ...

  2. PowerDesigner PDM生成sql脚本时:表的名称和表里面的字段名称都有引号解决。。。

    PowerDesigner PDM生成sql脚本时:表的名称和表里面的字段名称都有引号解决... 1.当你的PowerDesigner 是新安装时,你得设置可能就会出现一些问题,在这里比如:PDM生成 ...

  3. (转)powerdesigner 生成sql脚本使用的设置

    本文转载自:http://blog.163.com/lizhihaoo@126/blog/static/103121661201036171115/ 1. 生成sql脚本的时候,提示"con ...

  4. PowerDesigner生成sql脚本

    1.打开PowerDesigner->New Project; 2.填写项目名称,选择文件的存放路径: 3.新建一个模型,New Model: 4.选择概念模型,填写模型名称: 5.选择enti ...

  5. MySQL必知必会-官方数据库表及SQL脚本导入生成

    最近在复习SQL语句,看的是MySQL必知必会这本书,但是发现附录中只有表设计,没有表的具体数据.所以在学习相应的语句中体验不是很好,去网上查了数据库的内容,自己慢慢导入到了数据库中.把表放出来作为参 ...

  6. PD 15.1 安装 破解 , 简单使用 (一对多,多对多关系生成sql脚本) , CDM 和 PDM 的区别;PD15.1 生成sql2008 无FK外键约束的解决方法

    CDM是概念模型,在概念模型上没有具体数据库产品的概念,反映的是实体和联系.PDM是物理模型,是依赖具体数据库产品的模型,比如可以指定具体的数据类型和约束等等.在PowerDesigner中两个模型之 ...

  7. powerdesigner中物理模型与sql脚本的以及与数据库的连接设置

    使用JDBC连接失败的解决方案: http://blog.csdn.net/t37240/article/details/51595097 使用powerdesigner工具我们可以方便的根据需求分析 ...

  8. PowerDesigner数据模型(CDM—PDM—SQL脚本的转换流程)

    原文地址:PowerDesigner数据模型(CDM-PDM-SQL脚本的转换流程)作者:zzenglish 有图片的参考http://blog.sina.com.cn/s/blog_64742675 ...

  9. access生成sql脚本,通过VBA调用ADOX

    access生成sql脚本,通过VBA调用ADOX. 使用 MS Access 2016 的VBA,读取mdb文件中的所有表结构(数据类型/长度/精度等),生成对应的SQL create table语 ...

随机推荐

  1. IR2104s半桥驱动使用经验

    多次使用IR2104s,每次的调试都有种让人吐血的冲动.现在将使用过程遇到的错误给大家分享一下,方便大家找到思路. 一.自举电容部分(关键) 1.听说自举电路必须要安装场效应管,于是我在使用过程中,安 ...

  2. MySql数据库中,判断表、表字段是否存在,不存在就新增

    本文是针对MySql数据库创建的SQL脚本,别搞错咯. 判断表是否存在,不存在就可新增 CREATE TABLE IF NOT EXISTS `mem_cardtype_resource` ( ... ...

  3. Mac下vim7.4+vimgdb让vim支持gdb源码调试

    下载vimgdb https://github.com/cpiger/vimgdb-for-vim7.4 下载vim7.4源码 将两个文件或者文件夹放到同一个目录解压 tar xjvf vim-7.4 ...

  4. Javascript循环删除数组中元素的几种方法示例

    发现问题 大家在码代码的过程中,经常会遇到在循环中移除指定元素的需求.按照常规的思路,直接一个for循环,然后在循环里面来个if判断,在判断中删除掉指定元素即可.但是实际情况往往不会像预想的那样顺利运 ...

  5. Git命令(Git版本:Linux 2.14.3)

    常用 git status 跟踪状态git commit -m "xxx" yyy.cppgit pull git pushgit mergetool --tool=meld 合并 ...

  6. SV-assertion

    断言(assert)是一种描述性语言,通过描述的期望结果来进行仿真验证. 断言有一个更加基础的信息,我们称为属性(property),属性可以作为断言结果,功能覆盖点,形式检查和约束随机激励生成. 断 ...

  7. 【Qt官方MQTT库的使用,附一个MqttClient例子】

    Qt官方MQTT库的使用,附一个MqttClient例子 开发环境:win7 64 + Qt5.9 记录时间:2018年3月11日 00:48:42 联系邮箱: yexiaopeng1992@126. ...

  8. calss 类

    class Role(object): n = 123 # 类变量,像__init__中life_value,money默认参数用类变量,如果多个类的实例那就节省了内存,类变量只在类中存一份,实例中不 ...

  9. IP地址 0.0.0.0 是什么意思?

    IP地址0.0.0.0是什么意思? 根据RFC文档描述,它不只是代表本机,0.0.0.0/8可以表示本网络中的所有主机,0.0.0.0/32可以用作本机的源地址,0.0.0.0/8也可表示本网络上的某 ...

  10. shellinabox

    https://linux.cn/article-6046-1.html https://www.tecmint.com/shell-in-a-box-a-web-based-ssh-terminal ...