Tools:
Sybase PowerDesigner 12.5
Microsoft SQL Server 2005
Step 1: Outline Design
Open the PowerDesigner software and design the Conceptual Data Model ):
Figure 1
Design table structure:
Figure 2
When designing attributes (fields), three letters (M, P, and D) are represented respectively:
M: whether it is null. (√ indicates that it cannot be blank)
P: whether it is a primary key;
D: whether it is displayed in the view of the software;
Step 2: Detailed Design
To convert a table designed for "conceptual Data Model" to a "Physical Data Model", the table is actually converted from "Outline Design" to "Detailed design ", that is, the specific implementation of the table.
Select "Tools" --> "Generate Physical Data Model ..." You can.
Figure 3
Then select SQL Server 2005 database management software:
Figure 4
After you click "OK", the specific implementation of the table, attributes, and relationships corresponding to the "SQL Server 2005" database is generated.
Step 3: manually create a database in SQL Server 2005
For example, I manually create the Database "Students" example in SQL Server 2005.
Step 4: configure the user data source in the data source ODBC
For example, in the user data source, I add the Database "Students" data source.
Figure 5
Step 5: automatically create a table structure in SQL Server 2005
First, an SQL statement is automatically created based on the Physical Data Model:
Figure 6
Second, execute the SQL statement file, and automatically create the data table structure to the SQL Server 2005 database:
Figure 7
After completing the preceding steps, refresh SQL Server 2005 data and you will see the table structure you have created.
Of course, the above two steps (figure 6 and Figure 7) can be completed in one step:
In "Database" à "Database Generation", select "Direct generation:
Figure 8
In this way, all the steps for designing the SQL Server database using PowerDesigner are completed!