To define constraints for your columns

1. In the Tables Collection Editor, click the (Collections) entry next to Constraints in the Table Properties pane.

This displays the Constraints Collection Editor for the selected column.

  1. Click Add to add either a Unique Constraint or a Primary Key Constraint.
  2. If you selected Unique Constraint, the Unique Constraint dialog appears. Select one or more of the displayed column names. You can also select the Primary Key checkbox if you want to set the column as a primary key.

By setting the Unique Constraint on a column, you are enforcing the rule that all values in the column must be unique. This is useful for columns that contain identification numbers, such as employee numbers, social security numbers, part numbers, and so on.

Note: If you have already defined a primary-foreign key relationship between two tables, you may not be able to set a column as a primary key, based on the fact that it may already be set as the primary key, or based on a conflict with another relationship.

  1. If you selected Foreign Key Constraint, the Foreign Key Constraint dialog appears. Select the tables you want to relate by choosing them from the Parent table and Child table drop down lists.
  2. Click Key Columns to select the primary key column from the list.
  3. Click Foreign Key Columns to select the foreign key column from the list.

Warning: The primary key and foreign key columns must have the same data type and must contain unique values. Columns that can contain duplicates are not good choices for primary or foreign keys. It is common to choose the same column name from each table for your primary-foreign key relationship.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment