Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Create Relationships Between Tables on a Diagram (Visual Database Tools)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

You can create relationships between columns in different tables in the Diagram Designer by dragging columns between tables.

To create a relationship graphically

  1. In Database Designer, click the row selector for one or more database columns that you want to relate to a column in another table.

  2. Drag the selected column(s) to the related table.

  3. Two dialog boxes appear: Foreign Key Relationship and Tables and Columns, with the latter appearing in the foreground.

  4. Relationship name has a system-provided name in the format FK_localtable_foreigntable. You may change this value.

  5. Verify that Primary key table specifies the correct table.

  6. The grid lists the local columns and their matching foreign columns. You can add or remove table columns or change mappings.

  7. Choose OK.

    The Foreign Key Relationship dialog box appears. Selected Relationship shows the relationship you have created.

  8. Change properties for the relationship in the grid.

  9. Choose OK to create the relationship.

    Database Designer shows a relationship between the columns you chose.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft