PowerDesinger batch modification table prefix

Purpose:

Powerdesign batch modify table name steps: 1. ctrl + shift + x to open the running VBS code window 2. Copy the code below and run




Option ExplicitValidationMode = TrueInteractiveMode = im_BatchDim mdl'the current model'get the current active modelSet mdl = ActiveModelIf (mdl Is Nothing) ThenMsgBox "There is no current Model" ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox "The current model is not an Physical Data model."Else ProcessFolder mdlEnd If'This routine copy name into code for each table, each column'of the current folderPrivate sub ProcessFolder(folder) Dim Tab'running table Dim NameStr, CodeStr for each Tab in folder.tables'Modify Tab.name and Tab,code Tab.name = Replace( Tab.name, "old_", "new_") Tab.code = Replace( Tab .code, "old_", "new_") nextend sub

Leave a Comment

Your email address will not be published.