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

相关推荐
liu****1 分钟前
11.Linux进程信号(三)
linux·运维·服务器·数据结构·1024程序员节
郝学胜-神的一滴4 分钟前
Linux下,获取子进程退出值和异常终止信号
linux·服务器·开发语言·c++·程序人生
檀越剑指大厂14 分钟前
【Nginx系列】Tengine:基于 Nginx 的高性能 Web 服务器与反向代理服务器
服务器·前端·nginx
java1234_小锋15 分钟前
REDIS集群会有写操作丢失吗?为什么
数据库·redis·缓存
兰若姐姐17 分钟前
如何进行MSSQL提权?sp_oacreate、sp_oamethod和沙盒提权以及xp_regwrighte提权
数据库·sqlserver
一抓掉一大把17 分钟前
秒杀-订单创建消费者CreateOrderConsumer
网络·数据库
fufu03111 小时前
俄罗斯方块
linux·运维·服务器
合作小小程序员小小店1 小时前
web安全开发,在线%服务器日志入侵检测%系统安全开发,基于Python,flaskWeb,正则表达式检测,mysql数据库
服务器·python·安全·web安全·flask·安全威胁分析·安全架构
一只小bit2 小时前
MySQL事务:如何保证ACID?MVCC到底如何工作?
数据库·mysql·oracle
小猪咪piggy2 小时前
【项目】小型支付商城 MVC/DDD
java·jvm·数据库