Skip to content

Relationship Wizard

The Relationship Wizard provides the most effective means for creating new relationships. To use this wizard:

  1. Open the table that will be the child table (from table) in the new relationship. You must open the table in exclusive mode to edit relationships. See Open Modes for more information.

  2. Go to the Relationships Tab page of the table definition dialog.

  3. Click the Relationship Wizard toolbar button. This activates the Relationship Wizard dialog.

  4. Follow the wizard prompts and enter the following information:

Parent Table

On the 'Parent Table' wizard page, select the parent table (to table) for the relationship. The wizard displays a list of tables in the database. You can order the list by table number, table name, or description by clicking on the appropriate column heading.

Parent's Primary Key

On the 'Parent Primary Key' wizard page, select the primary key index from the parent table. This will define the primary key columns from the parent table that will be used in the relationship.

Foreign Key Matching Options

Next, you must match the parent table's primary key columns with foreign key columns in the child table. There are three different options you can use to match these columns. These are described below:

Select Columns that Match Primary Key Size & Type

If you check this option, you will be prompted to select columns from the child table whose size and data type match the columns from the parent's primary key.

Select Columns, Then Force a Match

If you check this option, you will select columns from the child table to pair with the parent's primary key columns. If the child table's columns are not the same type and length, the wizard will make the necessary adjustments to these columns to ensure that the type and length do match.

Warning: This could result in a loss of data from the child table's columns that are changed. This will depend on the type of changes that the wizard makes. For example, if the wizard needs to reduce the size of an ASCII column, some values in this column could be truncated. If a data column needs to be changed into a number column, the data in that column may no longer be valid, etc.

Create New Columns That Match the Primary Key

If you check this option, the wizard will create and use new column(s) in the child table that match the signature of the parent's primary key. The wizard will try to assign the same names to the new columns that were used in the primary key columns. If these names are not unique in the child table, the wizard will generate unique column names.

This option is the most productive way of defining a relationship and foreign key columns in one single process. The wizard ensures that column names are consistent in parent and child tables, and the relationship's column pairs will match size and type correctly.

Finish

When you have correctly entered all the wizard values, the final page will display a summary of the new relationship that will be created. Click the Finish button to build this relationship and return to the Relationships tab of the Table Definition dialog. Your new relationship will be displayed in the Relationships Summary panel.

See Also