Specifying primary keys and other constraints for a table
You can define one or more primary keys or other constraints for a SQL table.
-
On the Sql Tables form, click
one of these buttons:
- To define a new constraint, click New Constraint. Then specify a Constraint Type and its
related information:
- Primary Key
- Specify whether the constraint should be implemented with the Clustered Index attribute.
- Index
- Specify whether the constraint is Unique (that is, only one unique combination of the columns contained in the constraint is permitted in the table); and whether the constraint should be implemented with the Clustered Index attribute.
- Foreign Key
- From the Referenced Table drop-down list, select the table to which the current table refers.
- To change an existing constraint, select the constraint from
the grid and click Modify
Constraint.
The data type and constraint name display. You can modify any active fields/options.
- To define a new constraint, click New Constraint. Then specify a Constraint Type and its
related information:
- Click Next.
-
In the Columns panel,
select the column or columns you want to be constraints on the table.
To add them to the Keys pane, click Add.
To change the order of the columns on the constraint, use the Move Up or Move Down buttons.
- To delete an existing constraint, remove all columns in the Keys panel, by selecting them and then clicking Remove.
- To save your changes and return to the Sql Tables form, click Finish.
Related topics