Bagikan melalui


How to: Change Relationship Properties

Referential integrity between tables is enforced by default when you create a relationship. An enforced relationship ensures each value entered in a foreign key column matches an existing value in the related primary key column.

You can change the conditions under which referential integrity is enforced by editing the relationship's properties.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

To change relationship properties

  1. In Server Explorer, select the table involved in the relationship, and from the Database menu, click Open Table Definition.

    The table opens in Table Designer.

  2. From the Table Designer menu, click Relationships.

  3. In the Foreign Key Relationships dialog box, select the relationship in the Selected Relationship list.

  4. Change properties for the relationship in the grid.

The relationship is updated in the database when you save the table.

See Also

Other Resources

Working with Constraints

Working with Relationships