PowerDesigner中在生成的数据库脚本中用name列替换comment列作为字段描述的方法
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列作为字段描述的方法的更多相关文章
- 在PowerDesigner中自动生成sqlserver字段备注
在PowerDesigner中自动生成sqlserver字段备注 PowerDesigner是数据库设计人员常用的设计工具,但其自生默认生成的代码并不会生成sqlserver数据库的字段备注说明.在生 ...
- PowerDesigner中SQL文件、数据库表反向生成PDM
1 反向生成PDM 1) 创建一个空的PDM模型(选择相应的DBMS): 2) 选择[Database]--[Update Model from Database ...
- excel 中批量生成mysql的脚本
一.假设你的表格有A.B.C三列数据,希望导入到你的数据库中表格table,对应的字段分别是col1.col2.col3 二.在你的表格中增加一列,利用excel的公式自动生成sql语句,具体方法如下 ...
- Powerdesigner中如何生成测试数据
设计表完成以后,我们需要生成一些测试数据,可以直接更新到数据库中,下面我们就来试试: 第一步:建立需要的Profiles测试文件,[Model]--[Test Data Profiles],如图所示: ...
- PowerDesigner中如何生成主键和自增列
1.SQL Server版本: 第一步,首先要建立与数据库的连接,方法较多,这里举个例子: http://www.cnblogs.com/netsql/archive/2010/05/17/17375 ...
- PowerDesigner中翻转生成PDM图时把Name属性变成注释(转)
在pd里面运行下面这段代码'******************************************************************************'* File: ...
- 使用PowerDesigner生成Access数据库
PowerDesigner生成Access数据库 自从使用PD以来一直知道可以支持access但一直没有搞明白如何通过脚本来创建access数据表.在PD的tools里终于找到的答案,具体 文件都在C ...
- PowerDesigner从安装到同步数据库
前言 最近项目在如火如荼的进行着4.0版本的数据库设计工作,我们几个后端小伙伴也马不停蹄的进行着数据库的设计.使用的设计软件是PowerDesigner,这里记录一些常见的问题以备日后查看 安装 链接 ...
- powerdesigner 生成数据库脚本
PowerDesigner导出所有SQL脚本 操作:Database=>Generate Database PowerDesigner怎么导出建表sql脚本 1 按照数据库类型,切换数据库. D ...
随机推荐
- 不指定order by时Sql的排序
在sql中不指定Order by,排序是按照主键吗?答案是不一定.举个例子: 查询AttendanceEmpRank表,主键是AttendanceEmployeeRankId,而且是聚集索引 ...
- 未能加载文件或程序集 system.data.sqlite 完美解决
错误提示如下图所示: 解决办法: 使用SQLITE 预编译的静态链接DLL 下载地址:http://pan.baidu.com/s/1kT5i8bP
- oracle 11g 64位安装32位客户端和PL/SQL
转自:http://www.360doc.com/content/14/0602/10/4903283_382949382.shtml 这个你需要安装一个32位的oracle客户端才能使用plsq ...
- VS2015打开工程文件卡死
今天偶然遇到VS2015打开某个工程文件卡死,一直等待无响应: 关闭VS,打开另外一个工程文件是正常的: 开始怀疑是工程文件有问题,用VS2013打开是正常的,排除工程文件问题: 删除对应工程文件下的 ...
- 判别linux机器字节序为大端还是小端
代码如下: #include <iostream> #include <arpa/inet.h> #include <cstdio> using namespace ...
- 自定义View—坐标系
一.android默认坐标系 二.View 的 getXxx()的坐标系 三.event的坐标系
- DataTable 导出Excel 下载 (NPOI)
public class ExcelHelper { public void DownLoadExcelNew(System.Data.DataTable data, Hashtable h, ...
- 【转帖】C# DllImport 系统调用使用详解 托管代码的介绍 EntryPoint的使用
1 DLLImport的使用 using System; using System.Runtime.InteropServices; //命名空间 class Example { //用Dl ...
- 关于java.sql.SQLRecoverableException: Closed Connection异常的解决方案(转)
在项目中碰到了一个应用异常,从表象来看应用僵死.查看Weblogic状态为Running,内存无溢出,但是出现多次线程堵塞.查看Weblogic日志,发现程序出现多次Time Out. 我们知道,We ...
- Page Controller页面控制器实现
A Page Controller is one object or file declaration designed to handle the request for one logical w ...