Prev Next

Unique Constraints

Unique Constraints enforce the 'uniqueness' of a set of fields in all rows of a Table, which means that no two rows in a Table can have the same values in the fields of a Unique Constraint. Unique Constraints are similar to Primary Keys (in that they also enforce 'uniqueness') but the main difference is that a Table can have multiple Unique Constraints defined but only one Primary Key.

Access

Ribbon

Specialize > Tools > Database Builder > Click on Table name > Constraints/Indexes > Right-click > Add New Constraint

Context Menu

In diagram or Project Browser | Right-click on Table element | Features & Properties | Constraints/Indexes

Keyboard Shortcuts

Click on Table: F9 > Constraints/Indexes: Ctrl+N

Create a Constraint

Step

Action

See also

1

On the 'Constraints/Indexes' tab, a new constraint is automatically created and assigned the default constraint name and a 'Type' of index.

Overtype the constraint name with a name that identifies this as a unique constraint.

2

In the 'Type' field, change the value from 'index' to 'unique'.

Notes

  • Warning: Enterprise Architect assumes that Unique Constraints have at least one column assigned to them; however, Enterprise Architect does not enforce this rule during modeling
    If DDL is generated for a Table that has a unique constraint defined without column(s) assigned, that DDL will be invalid

Learn more