Problem:
In the software production process, sometimes the business needs change or the design strategy transformation, the design requirements for dozens or even hundreds of entities of a database physical model are adjusted and changed (the physical design tool is powerdesigner). For example, the Data Type of the object primary key changes from integer int to string varchar; or, because the database design specifications are modified, You need to modify the entity table naming prefix (suffix); or how to add annotations to tables and fields without annotations.
Our conventional practice is naturally "one by one" mechanical modify. Here we provide a method to save a complicated process and make it "fast, intelligent, and simplified ". "
Analyze the problem:
1. Manually repeat the modification in powerdesigner.
2. Change the manual mode and use scripts for batch Automatic modification.
Solution:
1. Here we will explain the requirement of "automatically adding name as annotation for tables and fields without annotation ".
2. Using the powerdesigner tool menu, you can run VBScript (there are many script files in the VB scripts folder under its main installation directory) to change the physical attributes of the physical model. This is our breakthrough.
3. Simple learning of VBScript syntax structure
4. Refer to the files in the installation directory of powerdesigner (for example, E: \ Sybase \ powerdesigner 15 \ VB scripts) to learn about the operable object attributes and names of the script.
5. Write a script to automatically add a name as a comment for tables and fields without comments. (See attachment)
Usage:
1. Try to write a VBScript to modify the attributes of a physical object.
1. Run powerdesigner, find (tool --> excute commands --> edit/run script) in the window menu, and click Open command window to copy or import the preceding scripts, click "run" in the lower right corner. (Script errors or successful running are highlighted ).
2. Check whether the comments of the debugging table and fields are successfully added.
Note: The above method is only applicable to Database Design Using powerdesigner. Other tools are to be tested.
(Note: All my articles are original articles. Please indicate the source for reprinting! Dao guangjianying 2012 is written in Shenzhen .)