PowerDesigner中把 Comment(描述/注释列)的内容,复制覆盖到 Name(名称列)里
- 在 PowerDesigner 中,按
Ctrl + Shift + X打开脚本运行窗口。 - 清空里面原有的内容,粘贴下面的代码:
' 把 Comment(描述)的内容 同步到 Name(名称)
Dim mdl ' 当前模型
Set mdl = ActiveModel
If mdl Is Nothing Then
MsgBox "没有打开模型"
Else
' 遍历所有表
Dim tab
For Each tab In mdl.Tables
If Not tab.IsShortCut Then
' 遍历表中的所有列
Dim col
For Each col In tab.Columns
' 只有当 Comment 不为空时,才进行覆盖
If col.Comment <> "" Then
col.Name = col.Comment
End If
Next
End If
Next
MsgBox "处理完成!已将描述更新到名称列。"
End If
- 点击 Run (运行) 按钮。
- 看到提示“处理完成”即可。

浙公网安备 33010602011771号