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

相关推荐
代码村新手41 分钟前
Linux的基本指令
linux·运维·服务器
MonolithIoT1 小时前
实战方案|设备备件无人值守仓库:连续化产线运维备件 7×24 小时数字化管控方案
运维·网络·数据库
瞬间&永恒~2 小时前
【MySQL】4-6:在同一个主机上使用 systemd 运行多个 MySQL服务器
服务器·数据库·mysql
心机之蛙qee2 小时前
Redis的主从、哨兵及集群
数据库·redis·缓存
gwf2162 小时前
磨损均衡算法(Wear Leveling)——SSD如何让每块闪存“公平退休“?
运维·数据库·人工智能·python·嵌入式硬件·算法·智能硬件
AAA@峥3 小时前
CentOS7 源码编译安装 MySQL5.7|SQL 基础操作 + 备份恢复完整实战
运维·数据库·sql·centos
xixingzhe23 小时前
spring ai简单使用skills
数据库·人工智能·spring
Fu2067213 小时前
数据库第三次作业
数据库
AI多Agent协作实战派4 小时前
AI多Agent协作系统实战(二十三):Agent读HEARTBEAT.md不读AGENTS.md——openclaw的文件加载之谜
前端·数据库·人工智能·uni-app
jun_bai4 小时前
postgresql数据库免安装版安装到windows系统
数据库·postgresql