Setting the primary key auto-increment problem when modeling with PowerDesigner

Source: Internet
Author: User
Tags powerdesigner

Research, in fact, just double-click the table, select columns, and then double-click on the key you want to set as the self-increment (such as your ID) or right-click the properties, pop up a columnproperties dialog box, we see the logo identify, tick. Columns has a funnel-shaped icon on the UI Customize Columns and filters
Click to select the column you want, there are: Default and Identity After the selection, the future table can only need to tick the line. In the CDM, the primary key auto-increment property cannot be set, only in PDM. Because in different databases, the primary key self-increment method is different, so sometimes you need to modify the default database platform. Change Platform method: Tool-->generate Physical Data mode--> general (opens here by default)-->dbms Choose your database platform ... ...........................................................

1. SQL Server version:

The first step, the first to establish a connection with the database, more methods, here for example:

Http://www.cnblogs.com/netsql/archive/2010/05/17/1737548.html

Second, open PD15, create a new PDM document, and then create a new table:

3rd Step: Open the t_id column's property settings, set the automatic generation

How to set the step size: as follows: Click Auto Increment column, there is a Microsoft column:

4th step, because the database connection was set up, this time click "Database"-"Generate database" can generate this table to the database, when SQL Server2005 view the table to create a diagram of the statement:

At this point, the SQL Server2005 created from 1 to complete, hehe.

2. Oracle version:

Here's how to create a new self-increment column in Oracle, in general you need to set up a sequence and pay the sequence to a column and rebuild the trigger.

The first step, the first to establish a connection with the database, more methods, here for example:

How to establish a connection with Oracle: http://www.cnblogs.com/netsql/archive/2010/05/19/1739491.html

In the second step, open PD15, create a new PDM document, and create a new table:

The third step is to create a sequence. In "Model"-"Sequence", open the Sequence List window and create a new sequence. Then open the sequence's property settings item "Physical Options", make the following settings, click OK, the sequence is complete.

Fourth, apply the sequence you just created to the table's primary key column: Click OK, it's not over at this point, the key step is to rebuild the trigger.

Fifth step: Rebuild the trigger, under Tools, click

Click OK to create a trigger automatically, adding the value of the sequence to the primary key.

3. mysql version:

Table Properties->columns
Choose your own add-on section, shortcut key Alt+enter

You can also display the self-growth property by making it visible.

Category: Databases

Setting the primary key auto-increment problem when modeling with PowerDesigner

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.