Primary Keys

A primary key constraint designates a column as the primary key of a table or view. A composite primary key designates a combination of columns as the primary key. A primary key combines a Not Null and unique constraint in one declaration. Therefore, to satisfy a primary key constraint no primary key value can appear in more than one row in the table, and no column that is part of the primary key can contain a Null. A table or view can have only one primary key.

To Create a Primary Key

Open the table you need and select New Primary Key on the Table menu. Add required columns to the key and click OK. You can also switch to the Constraints tab and create the primary key within the pop-up menu.

To Edit a Primary Key

Navigate to the key in Database Explorer and double-click it or open the table that owns the primary key, switch to the Constraints tab and select Edit Constraint on the pop-up menu.

Note

The already created Primary key can be edited only on the Constraints page. The Primary checkbox is inactive on opening a column.

To Drop a Primary Key

Navigate to the key in Database Explorer and select Delete on the shortcut menu or open the table that owns the primary key, switch to the Constraints tab and choose Delete Constraint on the key shortcut menu.