dbForge Studio allows creating two types of relations: physically existing foreign key relations and virtual relations.
They represent physically existing foreign key relations between tables. On the diagram, these relations are displayed as connecting lines. Their appearance depends on the selected notation.
Options available for managing physical relations are as follows:
Click a relation and press the DELETE key, then click Yes in the appeared dialog.
Note
When you delete a relation from the diagram, the corresponding foreign key is deleted from the database.
To change the relation’s parent table, drag the parent end of the relation to another table. You cannot change the relation’s child table.
Note
The relation cardinality is determined automatically from the child table constraints and cannot be changed by a user except for editing child table constraints.
Note
Relations on the diagram correspond to existing foreign keys in a database. When you create a relation on the diagram, a foreign key constraint is created in the database. If the foreign key cannot be created in the database, the relation cannot be created on the diagram.
Virtual relations allow you to create relations between tables if their storage engine does not support foreign keys. Virtual relations do not exist physically, but only stored on the diagram, however they can be converted to physical foreign keys. On the diagram they are displayed as thin dotted lines connecting tables.
You can move, bend, reroute virtual relations, drag a relation parent end to another table the same way as you do with physical relations.
You can also select entire tables to create a virtual relation between them. In this case, the Virtual Relation Properties dialog box will appear where you should select constraints and referenced columns.
Do either of these actions:
Use the Virtual Relation Manager window to view, edit, remove virtual relations, generate their DDL, convert to Foreign keys, etc.
To open it, click the Virtual Relation Manager icon on the toolbar or, on the View menu, point to Other Windows, and click Virtual Relation Manager. Right-click a required relation in the grid and select a required command from the menu.
Each relation has a comment - a yellow rectangle with a relation foreign key name. Select the Show Relation Comment check box in the diagram options or click Show Comments on the Diagram toolbar to display comments. By default, they are displayed near the child end of relations. You can drag them to any other place, and they will move with the relation. To hide a comment for a specific relation, click it and hit the DELETE key. To display it again, right-click the relation and select Show Comment from the shortcut menu.
Download dbForge Studio for SQL Server and try it absolutely free for 30 days!