Rebuilding Primary Keys

Rebuilding primary keys in a physical diagram updates primary keys for tables.

Rebuilding primary keys is useful following the reverse engineering of a database in which all of the primary keys could not be reverse engineered, or if you did not select the rebuild option for primary keys when you reverse engineered the database. The rebuild option for primary keys creates primary keys for tables that have no key and a single unique index.

You can choose to rebuild all primary keys in your model, or select the tables for which you want to rebuild the primary keys.

  1. Select Tools > Rebuild Objects > Rebuild Primary Keys to open the Rebuild Primary Keys dialog box, which lists all the tables in the current model.

    Note:

    To rebuild the primary keys in package, select the package from the list at the top of the tab.

    To rebuild the primary keys in a sub-package, select the Include Sub-Packages icon next to the list, and then select a sub-package from the dropdown list.

  2. Select the tables containing the primary keys that you want to rebuild.
    Note:

    You can select all check boxes, or clear all check boxes, by selecting the Select All tool, or Clear All tool, from the toolbar at the top of the tab.

  3. Click OK.