SQL Server – Export / Import a diagram

April 6, 2013 / SQL

A lot of people believe that in SQL Server it is not possible to import or export a diagram of a database to another database. And there are quite a few who ranked this issue among the disadvantages of SQL Server.

But I inform you that it is possible to Export / Import a database diagram in SQL Server. Here I give you the steps to follow so you can import or export a diagram of a database to another database.

Remember that the database diagrams are part of the database.

To address this problem, first, you should know that the information in the diagrams are stored in the table “dtproperties”, so you understand that to import or export a diagram, it is enough to import or export the table there.

Here are the steps to follow:

  • Right-click on the database that contains the schema to transfer, click ” All Tasks ” and then click “Export Data”.
  • In the Wizard Import / Export is displayed, click “Next”.
  • Set the source and then click the button “Next”. Normally the configuration is done automatically as the previous steps have been made to the source database that contains the chart to transfer.
  • Set the destination database and click the button ” Next “.
  • In the “Specify Table Copy or Query”, “click” use a query to specify the data to transfer, then click “Next”.
  • In “Enter the SQL statement “, type: ” Select * From dtproperties then click “Next”.
  • In “Select the tables and view source”, choose the table dtproperties in the destination column and then click “Next”.
  • Finally, in the “page Save, schedule and replicate package “, choose “Run Now ” click “Next” and then click “Finish”.

Leave a Reply

Your email address will not be published. Required fields are marked *