Defining a Primary Key
Define a
To define a primary key
- In your database diagram or Table Designer, click the row selector for the database column you want to define as the primary key. If you want to select multiple columns, hold down the CTRL key while you click the row selectors for the other columns.
- Right-click the row selector for the column and select Set Primary Key. A primary key
index , named "PK_" followed by the table name, is automatically created; you can find it on the Indexes/Keys tab of the property pages.
Warning If you want to redefine the primary key, any
A primary key column is identified by a primary key symbol in its row selector.
If a primary key consists of more than one column, duplicate values are allowed in one column, but each combination of values from all the columns in the primary key must be unique.
If you define a compound key, the order of columns in the primary key matches the order of columns as shown in the table in your diagram. However, you can change the order of columns after the primary key is created. For more information, see Modifying a Primary Key.
See Also
Constraints | Deleting a Primary Key Constraint | Enforcing Referential Integrity Between Tables | Modifying a Primary Key | Primary Key Constraints | Table Relationships