Changing foreign keys when altering a table

Use the Foreign Keys page of the Alter Table notebook to alter foreign keys for your table. A foreign key is a column or set of columns in a table whose values are required to match at least one primary key value of a row of its parent table. A referential constraint is the rule that the values of the foreign key are valid only if either:

You can alter or drop existing foreign keys. To drop a foreign key, select the foreign key you want to drop from the Foreign keys box and click on Remove.

Fields and controls

Authorities and privileges



To alter a foreign key:

  1. Open the Alter Table notebook.
  2. Click on the Foreign Keys tab.
  3. In the Foreign keys box, select the foreign key that you want to change.
  4. Click on Change. The Change Foreign Key window opens.
  5. Optional: Select a different parent table.
    1. Use the Table schema box to specify the new parent table's schema name.
    2. Use the Table name box to specify the new parent table's name. The Primary key box displays a list of the primary key columns defined for the new parent table.
  6. Optional: Select a new foreign key.
    1. In the Available columns box, select a column or columns that you want to define as a foreign key. Each column that you select must match a primary key column for the parent table in meaning and data type.
    2. Click on the > push button to move the selected column or columns to the Foreign key box.
  7. Optional: Change the option specified in the On delete box.
  8. Optional: Change the option specified in the On update box.
  9. Optional: Change the name of the constraint by typing a new name in the Constraint name field.
  10. Click on OK to make the changes you specified for the foreign key and close the Change Foreign Key window.
  11. If you do not want to make any additional changes to the table, click on OK to alter your table and close the Alter Table notebook. Otherwise, continue on to one or more of the optional tasks.


Related information