Powerdesigner cannot automatically generate comments,
To solve the problem that power designer cannot automatically generate comments, only three steps are required:
1. Press the shortcut key Alt + Shift + X to open the Script Editor;
2. Add the text script in the blue sky to the script editor;
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. isw.cut then
'Use the table name as a table comment
Tab. comment = tab. name
Dim col 'running column
For each col in tab. columns
'Combine the column name and comment into comment.
Col. comment = col. name
Next
End if
Next
Dim view 'running view
For each view in folder. Views
If not view. isw.cut 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. isw.cut then
ProcessFolder f
End if
Next
End sub
3. Click ''run.
Check whether the SQL script of the physical model has been commented out.