Modify or rename a constraint (ADP)

Microsoft Office Access 2003

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

  1. In the Database window, click Database Diagrams Button image under Objects, click the database diagram you want to open, and then click Design on the Database window toolbar.
  2. In your database diagram, right-click the table whose primary key you want to modify, and choose Indexes/Keys from the shortcut menu.
  3. Select the primary key index from the Selected index list.
  4. 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.

The primary key is updated in the database when you save your database diagram.

ShowModify a foreign key constraint

Modify the foreign key side of a relationship if you want to change which columns are related to columns in the primary key table.

  1. In the Database window, click Database Diagrams Button image under Objects, click the database diagram you want to open, and then click Design on the Database window toolbar.
  2. In your database diagram, right-click the relationship corresponding to the foreign key you want to modify, and then choose Properties from the shortcut menu.
  3. Choose the Relationships tab.
  4. Select the relationship from the Selected relationship list.
  5. In the Foreign key table column, expand the list in the first row.
  6. Select a different table column from the list. The foreign key column must match the data type and size of the primary key column, with these exceptions:
    • A char column or sysname column can relate to a varchar column.
    • A binary column can relate to a varbinary column.
    • A user-defined data type can relate to its base type.

Any changes you make to the relationship’s properties take effect as soon as you move outside the grid in the property pages. The constraint is updated in the database when you save your database diagram.

Note   Modifying a relationship in a database diagram marks both of the related tables as modified. Consequently, each table will also be marked as modified in any other database diagrams in which it appears.

ShowRename a check constraint

  1. In the Database window, click Database Diagrams Button image under Objects, click the database diagram you want to open, and then click Design on the Database window toolbar.
  2. In your database diagram, right-click the table containing the constraint, then select Constraints from the shortcut menu.
  3. Select the constraint you want to change from the Selected constraint list.
  4. Type a new name in the Constraint name box.
T he constraint name is updated in the database when you save your database diagram.

ShowModify a unique constraint

Modify a unique constraint when you want to change the columns that the constraint is attached to, change the constraint name, or set additional properties for the constraint.

  1. In the Database window, click Database Diagrams Button image under Objects, click the database diagram you want to open, and then click Design on the Database window toolbar.
  2. In your database diagram, right-click the table containing the constraint, then select Indexes/Keys from the shortcut menu.
  3. Select the constraint you want to change from the Selected index list.
  4. 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.

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