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

相关推荐
ZLRRLZ3 分钟前
【Linux操作系统】进程控制
linux·运维·服务器
程序新视界15 分钟前
在连表查询场景下,MySQL隐式转换存在的坑
数据库·mysql·dba
九河云41 分钟前
在云计算环境中实施有效的数据安全策略
大数据·网络·数据库·云计算
qq762118221 小时前
Linux c 在内存中创建zip,最后写入测试
linux·运维·服务器
jayxuyj1 小时前
MySQL8.0新特性探秘深入解析窗口函数的性能优化策略
服务器
华纳云IDC服务商1 小时前
网站服务器频繁掉线的主要原因是什么
运维·服务器
小黄人软件1 小时前
【部署python网站】宝塔面板 小目标2:实时搜索网上资源文件网站放在服务器上 用AI做一个作品,不断迭代。
运维·服务器
未来之窗软件服务1 小时前
服务器运维(四)服务器漏洞扫描工具与审查——东方仙化神期
运维·服务器·仙盟创梦ide·东方仙盟·东方仙盟运维
小猪写代码1 小时前
服务器相关:什么是 alios. centos. cuda. cuda tookit. gcc. cudann. pytorch.
服务器·pytorch·centos