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

相关推荐
裴东青33 分钟前
ProxySQL实现MySQL主从集群的读写分离
数据库·mysql·adb
张小姐的猫35 分钟前
【Linux】多线程 —— 线程同步 | 生产者消费者模型 | POSIX 信号量
linux·运维·服务器
handler0137 分钟前
【MySQL】教你库与表的增删查改操作(基础)
运维·数据库·笔记·sql·mysql·数据·分析
tedcloud1231 小时前
academic-research-skills部署教程:构建AI辅助科研环境
服务器·人工智能·word·excel·dreamweaver
姚不倒2 小时前
从零实现一个基于 Ollama + Go + MySQL 的 Text-to-SQL 智能体(M1 实战)
sql·mysql·云原生·golang
染指11102 小时前
9.LangChain框架(实现RAG)
数据库·人工智能·算法·机器学习·ai·大模型
Ether IC Verifier2 小时前
TCP 重传机制详解
服务器·网络·网络协议·tcp/ip·php
随便做点啥2 小时前
Intel Arc B60 Qwen3-Omni-30B-A3B 压测报告
服务器·经验分享
2401_873479402 小时前
主流IP离线库(IP数据云、纯真、IPIP.NET)怎么选?全面对比分析
服务器·网络·数据库
毋语天2 小时前
Redis 零基础实战指南:从核心原理到生产落地的完整路线
数据库·redis·缓存