Adding Database Objects to a Diagram

To add existing database objects to a diagram:

  • Drag a database object from Database Explorer and drop it to the diagram document.

    OR

  • In Database Explorer, right-click a database object, point to Send to, and then click Database Diagram.

To create new database objects, use Diagram toolbar buttons.

Adding Existing Database Objects

To add an existing database object, drag it from Database Explorer. Select multiple database objects in Database Explorer with SHIFT or CTRL key to drag them to the diagram.

This way, you can add tables, views, stored procedures, and functions to the diagram. Events cannot be added to a database diagram. Triggers are added to the diagram automatically with their tables.

If you drag a database to the diagram, all its objects will be added to the diagram.

Note

You cannot add database objects from a different connection to the same diagram.

Foreign key relations are displayed on the diagram automatically when both of the connected tables are displayed on the diagram.

Creating New Database Objects

To create a new database object on the diagram, perform the following steps:

  1. Click the corresponding button on the Diagram toolbar to create a corresponding database object, and then on the diagram sheet. A dialog box with the corresponding database object editor will appear.
  2. Set all required database object settings in the editor and click OK to create the database object.

You can also open the database object editor dialog by right-clicking a diagram and choosing items on the New submenu of the shortcut menu.

To create a new foreign key relation between two diagram tables, you may perform the following steps:

  1. Click the New Relation button on the Diagram toolbar.
  2. Click the child table and move the mouse pointer, holding the mouse button pressed, to the parent table. Then, release the mouse button. A partially initialized New Foreign Key Dialog Box will appear.
  3. Specify the missing parameters in the dialog box and click OK.