Today, we will go through a tool – ApexSQL Model which you can use for database modeling. To give you small idea about database modelling, let us understand first what is Database Modelling –
A database model is a type of data model that determines the logical structure of a database and fundamentally determines in which manner data can be stored, organized and manipulated.
There are different tools you can use to create data modelling and today we will go through ApexSQL Model.
ApexSQL Model is a tool which can be used for creating database model diagrams and synchronizing changes to and from existing databases and most important thing it is free to use. You can download tool from Apex website.
Under the Add section, there are options for adding objects within the model diagram, such as tables, relationships, schemas and notes:
The Engineer section contains the options that are used for forward and reverse engineering, such as creating database from model, creating script of objects on diagram, updating database from model and creating model from database:
The External functions offers users comparing and documenting options, such as compare model to a database, compare model to a snapshot and document model diagram. ApexSQL Diff is using for comparing, while ApexSQL Doc is using for documenting model diagrams:
Under the View tab, Display and Show sections are located.
The Display section contains Layout (Orthogonal, Compact orthogonal, Direct orthogonal, Circular, Hierarchical, Tree) and Edge routing (Orthogonal, Polyline, Channel, Organic) options. Also, there is a Show labels option for showing or hiding dependencies types:
The Show section contains options for showing or hiding browser and overview panels:
The fourth and final panel Resources includes options which allow users to get in touch with ApexSQL Support teams and to handle service and support related tasks:
The main window of ApexSQL Model is shown when the application is started:
To create model from database, click on the Create model button under the Actions tab. The Create model dialog with SQL Server connection options will be shown, where the desired database needs to be selected for reverse engineering:
When the selected database is connected and loaded, the data model diagram will be shown in the main window:
And here is the look of the filter setup in Blue theme:
Model level options
The ApexSQL Model offers users editing project level options. These are options that are model specific and can be changed independent of the application options. Click on the Edit button under the Home tab and the Model options dialog will appear:
The file locations and templates of the model script can be predefined. Also, location for the Rollback and backup file can be selected:
To create a database from a model, click on the Create database button in the Actions tab. The Create database window will be shown where database script can be opened or executed for the existing model:
When the SQL Server connection parameters and the new database name are specified, click the Open script button and the SQL script for creating the new database will be opened in the integrated script editor of ApexSQL Model. The script can be viewed, updated and executed to create the new database:
To update a database from a model, open the model that needs to be updated, then click on the Update database button in the Actions tab. The Update database window will be shown where database script can be opened or executed with changes for the existing model:
Click on the Execute button and database script will be executed with changes for the existing model:
After executing database script, database will be sucsesfully updated: