Tools:
Sybase PowerDesigner 15.1
Microsoft SQL Server 2005
The first step is a summary design:
Open the PowerDesigner software and design the conceptual data Model (conceptual):
Click Workspace Right---"new->conceptual Data Model,
The following screen appears:
Design table, table structure:
in Design properties (field), three letters (M, P, D) indicate:
M: is empty; (√ means null is not allowed)
P: whether the primary key;
D: Whether to display in the view of the software
Step Two: Physical design
Converting a table designed by the conceptual data Model to a physical data model is actually a transition from a "physical" to a "detailed design", which is a concrete implementation of a table.
Convert a profile design template to a physical design
Select "Tools"--"Generate physical Data Model ...".
Then select your DBMS.
When you click the "OK" button, a specific implementation of the table, properties, and relationships for the SQL Server 2005 database is generated.
Then there will be a template of the physical design that will transform the entities you have in the outline design into specific tables.
step three: in SQL Server 2005 Create a database manually (or you can create a library with SQL, PD can convert our table design to SQL)
You need to manually create your data in SQL SERVER 2005! such as: "Students", this process omitted ...
Fourth step: In the data source ODBC Configure user data sources in
Fifth step: in SQL Server 2005 Automatically create table structure in
First: The corresponding SQL statements are automatically established according to the physical data Model (physical):
Second: Execute the SQL statement file that it created, and automatically create the data table structure into the SQL Server 2005 database:
After you complete the steps above, refresh the SQL Server 2005 data and you will see the related table structure you created.
In addition, a single-sheet SQL statement can be generated:
In the physical design template, select Table--"Right-click" SQL perview ...
Generate SQL Create libraries and tables and we can see that the generated SQL statements are pretty good.
To establish the primary foreign key relationship for a table:
using the PowerDesigner physical model to add foreign keys to a relational table , there is a principle that the primary key name of the primary table must match the foreign key name of the secondary table.
Testing (test only, without technology)
1. Build the main Table User 2. Department table
UID Int primary key did int primary key
Name varchar (+) UID int
2. Right-click on the Model new->reference
The parent table is the user table and the child table is Department
This establishes the relationship, and the external build is automatically established.
On the establishment of the table relationship, I also doubt, but there are three kinds of ideas:
1. Design a good relationship in outline design. (personal preference in this way, have time to try)
2, the design of the physical design of the relationship (I use this method, if a lot of tables, the relationship is complex, this stage design relationship will be very painful. I am deeply hurt by it! )
3, build the database, the relationship between the DBMS (this way is the author's whim, think carefully, do not recommend this way, if you use T-SQL to reconstruct the database, you have to rebuild the relationship)
After careful consideration, the individual considers the design of the entity, entity, entity and entity relationships, and then details the design of the table properties when the database is physically designed.