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

相关推荐
数据库小学妹几秒前
数据库管理工具有哪些?2026主流工具分类与选型对照
数据库·数据库管理工具·数据库工具·信创数据库·数据库客户端
bingHHB3 分钟前
销售订单同步实战:MES生产领料/补料→金蝶材料出库
数据库·集成测试
yexianglunbai14 分钟前
冷备份与热备份的区别详解
数据库
ZhengEnCi15 分钟前
SQL 与 NoSQL 本质差异完全指南:从数据模型到选型决策的深度剖析
数据库
龙腾AI白云18 分钟前
数字孪生:与人工智能融合的技术图景
大数据·数据库·人工智能·知识图谱
刘胡子大叔18 分钟前
服务器不能编译怎么办
运维·服务器
imDwAaY30 分钟前
程序里的地址是真实内存地址吗?从虚拟内存到地址转换
java·linux·服务器
夜雪一千32 分钟前
MySQL中修改JSON类型的数据实战
数据库·mysql·json
竣达技术1 小时前
就地显示 + 远程上传,铅酸蓄电池在线监测完整解决方案
运维·数据库
HUIBUR科技1 小时前
AI 中枢,面向企业场景构建的 AI 智能体
前端·数据库·人工智能