Reverse engineering a data source to a new model

Applies to
ApexSQL Model

Summary
This article explains how to reverse engineering a database to a new model using ApexSQL Model, a SQL Server database modeling tool.

About reverse engineering

Reverse engineering represents a process of disassembling a physical model and recreating a logical model from it. This process extracts information from an existing data source to create a new logical model that can be analyzed. Reverse engineering specifically, only live databases can be used as a data source (vs SQL scripts or ApexSQL schema snapshots).

Description

To start the reverse engineering process in ApexSQL Model, click on the New button from the Home tab, to create a new model:

Quick tip:

Prior to reverse engineering a new model, save and close existing model, if any. You will be prompted to save changes and any unsaved existing model will be overwritten

In the next step click on the Create model button and the Create model window will appear. Enter the SQL Server connection details, select the desired database that needs to be reverse engineered and click the OK button:

A progress bar will appear showing outgoing process of creating a new model:

Once the process is finished, the reversed engineered database will be shown in a form of data model diagram representing the logical model of a database, showing tables and its relationships:

The newly created model will inherit the currently saved settings for Layout e.g. Hierarchical and Edge routing e.g. Orthogonal.

All selected data model options which are used and later saved to the created model will persist and the model in the next session will inherit those settings. These settings include diagram Layout and Edge routing options:

Quick tip:

Layout and edge routing options for created models can be configured in View ribbon bar allowing the user to choose how the model will be presented

FAQs

Q: Do I have to save and close my existing model, prior to reverse engineering?

A: Yes, all setup and changes performed on existing model will be lost unless saved prior to reverse engineering on other data source. If existing model isn’t saved, it will be lost and can’t be recovered or action undone

Q: Is it possible to add model to an existing model?

A: When you try to add a model an existing model, ApexSQL Model offers users the ability to save the current model or not. No matter what you choose save or not, the existing model will be deleted, and new model will be loaded.

Q: Can objects be imported to an existing model?

A: No, objects and groups of objects cannot currently be imported into an existing model.

Q: Does ApexSQL Model include a table editor?

A: Yes, tables can be created or edited and changes can be saved to the model.

Q: What object types can be reverse engineered?

A: Currently only tables, relationships and schemas are available for modeling. All other existing SQL objects are loaded to the database model when creating model from database.