'------------------------------------------------------------"'Scripting Features:'after reverse engineering is completed in PowerDesigner, the comment script in the database is'assign to the name of PDM'Execution Method:'Open pdm--tools--execute commands--run Script"'------------------------------------------------------------Option ExplicitValidationmode=TrueInteractivemode=Im_batchDimmdl'The current model'get the current active modelSetMDL =ActivemodelIf(MDL is Nothing) Then MsgBox "There is no current Model" ElseIf notmdl. IsKindOf (Pdpdm.cls_model) Then MsgBox "The current model isn't an physical Data model." ElseProcessFolder MDLEnd If '------------------------------------------------------------'This routine copy name to code for each table, each column'And each view of the current folder'------------------------------------------------------------Private SubProcessFolder (folder)Dim Tab 'Running Table for each Tab inchFolder.tablesif not Tab. isshortcut Then if Len(Tab. Comment) <>0 Then Tab. Name =Tab. CommentEnd if on Error Resume Next DimCol'Running Column for eachColinch Tab. Columnsif Len(col.comment) <>0 ThenCol.name=col.commentEnd if on Error Resume Next Next End if Next End Sub '------------------------------------------------------------
Source: http://blog.sina.com.cn/s/blog_538439270100rdxl.html
Reverse engineering in PowerDesigner assigns the comment in the database to the name