PowerDesigner 批量添加字段


Option Explicit

Dim mdl ' the current model
Set mdl = ActiveModel
Dim Tab 'running table
Dim col_1
Dim col_2
Dim col_3
Dim col_4

' 定義屬性變量
for each Tab in ActiveModel.Tables

Set col_1 = Tab.Columns.CreateNew
Set col_2 = Tab.Columns.CreateNew
Set col_3 = Tab.Columns.CreateNew
Set col_4 = Tab.Columns.CreateNew

'添加公共字段 by Sinu

col_1.name = "創建人"
col_1.code = "CJR"
col_1.DataType = "varchar(50)"
col_1.comment= "創建人"

col_2.name = "創建時間"
col_2.code = "CJSJ"
col_2.DataType = "datetime"
col_2.comment= "創建時間"

col_3.name = "修改人"
col_3.code = "XGR"
col_3.DataType = "varchar(50)"
col_3.comment= "修改人"

col_4.name = "修改時間"
col_4.code = "XGSJ"
col_4.DataType = "datetime"
col_4.comment= "修改時間"

next
MsgBox "success"


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM