Modifying a Primary Key
Modify a primary key if you want to change the column order, index name, clustered option, or fill factor.
To modify a primary key
- In your database diagram, right-click the table whose primary key you want to modify, and choose Properties from the shortcut menu.
Open the Table Designer for the table whose primary key you want to modify, right-click in the Table Designer, and choose Properties from the shortcut menu.
- Choose the Indexes/Keys tab.
- Select the primary key index from the Selected index list.
- 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, remove the columns from the primary key. Then add the columns back in the order you want. To remove a column from the key, simply remove the column name from the Column name list. Rename the primary key Type a new name in the Index name box. Make sure that your new name does not 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. For more information about fill factors and their uses, see the SQL Server documentation.
The primary key is updated in the database when you save your table or diagram.