Partager via


How to: Copy Tables from One Database Diagrams to Another

You can copy a table from one database diagram to another in the same database.

Copying a table from one database diagram to another diagram adds a reference to the table in the second diagram. The table is not duplicated in your database. For example, if you copy the authors table from one database diagram to another, each diagram references the same authors table in the database.

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 copy a table from another database diagram

  1. Make sure you are connected to the database whose table you want to copy.

  2. Open the source and target database diagrams and within the source diagram, select the table that you want to copy to the target diagram.

  3. Click the Copy button on the toolbar. This action places the selected table definition on the Clipboard.

  4. Switch to the target diagram. This diagram must be in the same database as the source diagram.

  5. Click the Paste button on the toolbar. The Clipboard contents appear at the new location and remain highlighted until you click elsewhere. If relationships exist between the selected tables and other tables in the target diagram, relationship lines are automatically drawn.

When you edit the table in either diagram, your changes are reflected in both diagrams. Similarly, once you save the table in either diagram, the table is no longer considered "modified" in either diagram.

See Also

Tasks

How to: Add Tables to Diagrams

Other Resources

Working with Database Diagrams