Working with Unique Constraint
Unique constraints help to enforce the uniqueness of specific columns. You can add unique constraints to an entity to make sure that no duplicate values are entered in specific columns. A unique constraint may consist of a single column, or combination of columns.
Creating a unique constraint
To create a unique constraint:
- Right click on the entity and select Open Specification... from the popup menu.
- Open the Constraints tab.
- At the bottom right of the specification window, click Add > Unique Constraint....
Add a unique constraint
- In the Unique Constraint Specification window, enter the name of the constraint.
Name the unique constraint
- Select the columns to be included and click >.
Add columns to the constraint
- Click OK to return to the Entity Specification.
- Click OK to return to the diagram. You can see the selected column(s) is marked unique.
Columns marked unique
Showing the name of unique constraints in entity
To show the name of unique constraint in entities in an ERD, right click on the ERD and select Presentation Options > Entity Columns Display Options > Show Column Unique Constraint Name from the popup menu. With enough shape width, you can see the constraint names of columns.
|Constraint name shown
The following resources may help you to learn more about the topic discussed in this page.
|10. Modeling Triggers in ERD||Table of Contents||12. Using ID Generator|