Designing a SQL Server database using PowerDesigner

Source: Internet
Author: User
Tags microsoft sql server microsoft sql server 2005 powerdesigner

Tools:

Sybase PowerDesigner 12.5

Microsoft SQL Server 2005

First step: Conceptual data Model

Open the PowerDesigner software and design the " Conceptual data Model " (conceptual), which is typically used in the outline design phase.

Design Table Structure

Note: If the Palette (tool panel) is not displayed, you can right-click on the toolbar and select "Palette" (tick)

The design results are as follows:

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 it is displayed in the view of the software;

When adding a "relationship" relationship, be aware that:

1. In all entity objects, the name of the attribute cannot be duplicated.

2. When adding referential integrity, the foreign key table does not have to add the primary key field of the primary key table as the foreign key. Because, after you add a "relationship" relationship, and then convert to a physical model, the foreign key table automatically adds the Foreign key field column.

3, when the "relationship" relationship is added, the starting point entity defaults to the primary key table, and the end point entity defaults to the foreign key table. Of course, it can be changed in "relationship".

Step two: Physical data model

Converting the relevant design of the conceptual data Model to the physical data Model , which is equivalent to converting from "physical" to "detailed design", is a concrete implementation of tables and relationships.

Select "Tools"--"Generate physical Data Model ...".

Then select SQL Server 2005 database management software:

When you click the "OK" button, a specific implementation of the table, properties, and relationships for the SQL Server 2005 database is generated.

adding a constraint in PowerDesigner

1> to view or set related constraints on a property (field)

2> setting " identity column " (autogrow)

3> Settings " Default Value

4> Settings " Check Constraint

5> settings Unique index

The conceptual data model differs from some of the details in the physical data model:

1> in the conceptual model, do not add the related constraints of the table, should add the related constraints of the table in the physical model;

2> only in the physical model will the PowerDesigner display the Database menu item. The database Generation option is only available in the Database menu item (for generating SQL statements);

step three: in SQL Server 2005 Create a database manually in

For example, I manually created the database "Students" Sample in SQL Server 2005.

Fourth step: In the data source ODBC Configure user data sources in

For example, I add a data source for the database "Students" in the user data source.

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.

of course, the above two steps can be done together:

Simply select "Direct Generation" in "Database" and "Database Generation" to:

this way, using PowerDesigner Design SQL Server The basic steps of the database are all done!

Designing a SQL Server database using PowerDesigner

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.