Chapter 3 Building Physical Diagrams


Designating an alternate key

An alternate key is made up of one or more columns whose values uniquely identify every row in the table, and is not a primary key. An alternate key can also be a foreign key. Each alternate key can generate a unique index or a unique constraint in a target database.

Create key tool

You can also select one or several columns and use the Create Key tool in the Columns page of the table property sheet.

Steps To designate an alternate key:

  1. Double-click a table in the diagram.

    The property sheet for the table appears.
  2. Click the Keys tab.

    The Keys page appears. It lists keys defined for the table.
  3. Click a blank line in the list.

    or

    Click the Add a Row tool.

    An arrow appears at the beginning of the line.
  4. Type a key name and a key code.

    Note   Alternate key naming convention
    The naming convention for an alternate key is AK followed by the number of the key column code; for example AK1_CUSNAME.



  5. <optional> Type a constraint name in the Constraint Name column.

    If you do not specify a constraint name, PowerDesigner creates a default constraint name automatically.

    Note   Display the column you need
    If you do not see the column you need, display it with the Customize Columns and Filter tool. See the Defining a filter on a list section in the General Features Guide.

  6. Click Apply.

    The constraint name and code are committed.
  7. Click the new key name.

    An arrow appears at the beginning of the line.
  8. Click the Properties tool.

    The property sheet for the new key appears.
  9. Click the columns tab.

    The columns page appears. It lists all columns defined for the key. At key creation, the list is empty.
  10. Click the Add Columns tool.

    A list of columns, defined for the table appears. This list does not include primary key columns.
  11. Select check boxes for one or more columns that you want to designate as alternate key columns.
  12. Click OK in each of the dialog boxes.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.