Notes are automatically generated when powerdesign exports SQL, and powerdesign exports SQL

Source: Internet
Author: User

Notes are automatically generated when powerdesign exports SQL, and powerdesign exports SQL

1. Script

Run

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 annotation instead of doing this.
Tab. comment = tab. name
Dim col 'running column
For each col in tab. columns
'Merge 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


Click run.



Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.