powerdesigner导出sql将name放到comment注释上

1. 批量设置

2. 脚本

vbs 复制代码
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
	if trim(tab.comment)="" then'如果有表的注释,则不改变它.如果没有表注释.则把name添加到注释里面.
		tab.comment = tab.name
	end if
 Dim col' running column?
 for each col in tab.columns
  if trim(col.comment)="" then'如果col的comment为空,则填入name,如果已有注释,则不添加;这样可以避免已有注释丢失.
   col.comment= col.name
  end if
 next 
  end if
 next 
 
 Dim view'running view
 for each view in folder.Views
  if not view.isShortcut and trim(view.comment)="" 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

3. 结果

好了

4. 生成sql

相关推荐
杨云龙UP7 分钟前
Linux LVM 在线扩容标准操作流程_20260102
linux·运维·服务器·centos·ux
CS创新实验室15 分钟前
《计算机网络》深入学:虚电路
服务器·计算机网络·php·虚电路
严同学正在努力25 分钟前
VMware安装银河麒麟V10操作系统X86_64全过程
数据库·鸿蒙系统·kylin
智源研究院官方账号36 分钟前
众智FlagOS 1.6发布,以统一架构推动AI硬件、软件技术生态创新发展
数据库·人工智能·算法·架构·编辑器·硬件工程·开源软件
dishugj41 分钟前
[SQLSERVER] Lock Waits/sec参数含义详解
数据库·oracle·sqlserver
我科绝伦(Huanhuan Zhou)43 分钟前
Oracle锁等待深度解析:从理论到实战的全方位指南
数据库·oracle
小Mie不吃饭44 分钟前
Oracle vs MySQL 全面对比分析
数据库·mysql·oracle
我科绝伦(Huanhuan Zhou)1 小时前
KingbaseES数据库备份与恢复深度解析:原理、策略与实践
数据库·金仓数据库
烤鱼骑不快1 小时前
ubuntu系统安装以及设置
linux·数据库·ubuntu
BORN(^-^)1 小时前
达梦数据库索引删除操作小记
数据库·达梦