Modifying a Primary Key

See Also

Modify a primary key if you want to change the column order, index name, clustered option, or fill factor.

To modify a primary key

  1. In your database diagram, select the table whose primary key you want to modify.

  2. Right-click the table and select Properties.

  3. Choose the Indexes/Keys tab.

  4. Select the primary key index from the Selected index list.

  5. Complete an action from the following table:

    Note   Some databases have different functionality for primary key constraints. For more information about the differences between databases, see Database Server Considerations. Consult your database documentation for details about how your database works with primary key constraints.
    To Follow these steps
    Change the column order In the Column name grid, expand the list of columns and select the column that you want to order first in the primary key. Repeat this step in subsequent rows of the Column name grid to reorder the remaining columns in the primary key.

    Note   Each column name must be unique in a primary key. If you select the same column name in more than one row of the Column name grid, an error will prevent you from saving the table.

    Rename the primary key Type a new name in the Index name box. Make sure that your new name doesn’t duplicate a name in the Selected index list.
    Set the clustered option (Microsoft SQL Server only.) Select the Create as CLUSTERED check box. Only one clustered index can exist per table. If this option is not available for your index, you must first clear this setting on the existing clustered index.
    Define a fill factor (Microsoft SQL Server only.) Type an integer from 0 to 100 in the Fill factor box. Type 0 to accept the default fill factor.

The constraint is updated in the database when you save your table or diagram.