Define a primary key
Define a primary key by using the Table Definition wizard. A primary key consists of a column or columns whose value uniquely identifies a row. There can only be one primary key per table. When you define a primary key for a table, you create a constraint on data in the table, which ensures that any row in the table can be uniquely identified by its key columns.
When you create a table, you can define the primary key after you define the columns.
To define a primary key for a table:
- On the Primary Key page of the New Table Definition wizard, type a name for the primary key. If you do not name the key, a default name is generated.
- Select the columns you want to include as part of the key from the list of source columns on the left.
- Click > to add these columns to the primary key list on the right.
- Complete the remaining New Table wizard pages and click Finish. The table is added to your database, and its primary key is available for reference by foreign keys in other databases.
Note: If you delete a primary key (either by removing the constraint, its columns, or the table that defines it), any foreign key constraints that reference the key are also removed.
You can change, add, or delete primary keys by using the table editor. To open the table editor, double-click on the table in the Data Definition view.
Parent topic
Defining a table