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

A new version of Table Designer appears for databases in the SQL Server 2012 format. This topic describes the old version of Table Designer, which you use with databases in earlier formats of SQL Server.

In the new version, you can change a table definition through a graphical interface or directly in a script pane. If you use the graphical interface, the table’s definition is automatically updated in the script pane. To apply the SQL code in the script pane, choose the Update button. For more information about the new version, see How to: Create Database Objects Using Table Designer.

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 Customizing Development Settings in Visual Studio.

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