Edit or delete database objects on a diagram

After you add objects to a database diagram, you can rename them, edit their properties, or remove them from the diagram.

Rename an object

1. Right-click the object, then select Rename.

2. Enter a new name and press Enter.

3. In the confirmation dialog, select Yes.

The object name field in edit mode: cursor visible next to the name

Edit an object on a diagram

1. Open an object editor in one of the following ways:

  • Double-click the object shape.

  • Right-click the object and select Open Editor.

2. In the editor, make your changes.

Note

The properties you need to specify depend on the object type. For more information about editing objects, see:

  • Table Designer
  • View Designer
  • Procedure Designer
  • Function Designer

3. To generate a DDL script for review before execution, at the bottom of the editor, click the arrow next to Script Changes, then select To New SQL Window.

The Script Changes button in the table editor

4. Save the object, then close the editor.

Modify a view, stored procedure, or function using SQL

You can also edit a view, stored procedure, or function by modifying its SQL definition. To do that, right-click an object and select Modify via SQL.

Shortcut menu opened on a database object in a diagram, showing available options including the Modify via SQL option

A SQL document opens with an ALTER statement containing the object’s current definition. Edit the statement, then execute it to apply the changes to the database.

An SQL document with an ALTER statement for modifying an object using the Modify via SQL option

Synchronize a database diagram with Document Outline

To display database objects in Document Outline, right-click an object in the diagram and select Synchronize with Document Outline.

The Document Outline window displaying the diagram structure with a database object selected and highlighted in the tree

On first use, this command opens the Document Outline window, synchronizes the document structure with the current diagram, and displays the objects in the Document Outline tree.

On subsequent uses, the command updates the already open Document Outline window.

For more information about Document Outline, see Document Outline window.

Delete an object

You can remove an object from the diagram or permanently drop it from the database.

To remove an object from the diagram but keep it in the database:

  • Right-click the object and select Remove from Diagram.

  • Select the object and press Delete.

To permanently drop an object from the database:

  • Right-click the object and select Drop from Database.

  • Select the object and press Ctrl+Delete.

Shortcut menu opened on a database object in a diagram, showing available options including the Remove from Diagram and Drop from Database options

Drop object elements from the database

You can drop table elements—columns, indexes, constraints, triggers, and relationships (foreign keys)—from the database using the diagram.

To do this, right-click the object and select Drop from Database, or select the element and press Ctrl+Delete. This permanently deletes the object from the database and cannot be undone by refreshing the diagram.

Shortcut menu opened on a column in a database object, showing available options including the Drop from Database option