What’s new in ApexSQL Model 2019

We are excited to announce that ApexSQL Model 2019 has just been published. In the latest version of the SQL data modeling tool, we have added eight new features that will enhance our users’ experience.

New features in the latest release:

  • Constraint customization
  • Create a model from a snapshot
  • Export (partial diagram selection)
  • Generate SQL script from model
  • Import only selected objects from database to model
  • Index customization
  • Profiles for table customization
  • Show/hide tables on diagrams

Let’s start with the introduction of those features.

Profiles for table customization

In the Options window under Table style tab selecting a profile selects predefined options for displaying tables on a diagram:

Profiles for table customization

By selecting one of the profiles (Simple, Detailed or Compact), predefined options for the selected profiles will be selected. If any of the below options are additionally checked or unchecked, the type of profile will be changed to the custom profile.

Depending on which profile is chosen, a table will look like this:

Simple:

Simple table customization

Compact:

Compact table customization

Detailed:

Detailed table customization

Custom:

Custom table customization

Export part of a diagram

All export options are grouped under one Export button.

This feature enables the export of selected tables as an image. It can be done by choosing tables from the right-click context menu choosing Export then clicking on the Selected image option:

Export selected table or tables as an image using SQL data modeling tool

This option can also be chosen from the Home ribbon tab by selecting Export, then Selected image option:

Export selected table as image

Standalone script generator

This is the option for generating script from tables on diagram using the SQL data modeling tool. It can be done by clicking on Create script option from the Action ribbon tab:

Create script using SQL data modeling tool

Dialog for selecting which tables will be included in the script will appear:

the selected objects will be included in the script

Selected tables will be included in script generation and by clicking on the OK button, the generated script will be opened in the selected editor from Model project options (integrated editor, SQL Server Management Studio or some other):

using SQL data modeling tool for generate script

Integrated editor

SQL script generator integrated in the SQL data modeling tool

SQL Server Management Studio

SQL Server Management Studio showing SQL script using data modeling tool

Show/hide tables on diagrams

This option is for showing or hiding tables on the diagram. By pressing the right mouse click on the table and selecting the Hide option from the context menu, the currently selected table will hide. Selecting a few tables and pressing right mouse click then selecting the Hide selected option from the context menu it will hide all selected tables at once:

Hide table on diagrams for a data modeling tool

Hide tables on diagrams for data modeling tool

Tables can be shown again by pressing the right mouse click and selecting Show hidden option from the context menu or by selecting the Show hidden option from the View ribbon tab:

Show hidden table on diagrams

Show hidden table on diagrams using data modeling tool

With the SQL data modeling tool, tables can also be shown or hidden by selecting or deselecting them in an object browser.

Hidden tables will not be included in forward engineering (Create database, Create script and Update database):

Show all tables using SQL data modeling tool

Import only selected objects from database to model

Using the SQL data modeling tool now can import only selected objects.

Selecting Create model option from Actions ribbon tab then by selecting the desired database and server and switching to the object filter tab in Create model dialog will show objects from the database:

Create SQL model using data modeling tool

Only selected objects will be imported into the diagram when OK button is clicked:

import only selected objects using SQL data modeling tool

Index customization

Indexes can be added when tables are created or later by using the Edit option.

Indexes can be customized in the Edit table form, which can be done when adding a new table or editing an existing one. To add a new table, press the right mouse click on empty space in the diagram and select Add option from the context menu or edit existing one by pressing right mouse click on table and selecting the Edit option from the context menu:

edit index with data modeling tool

Select Index tab for customizing indexes.

Edit table form will open, for customizing indexes select Indexes tab:

add index using a data modeling tool

When the Indexes tab is selected all existing indexes will be listed, and they can be edited, deleted or created by clicking appropriate buttons.

The new index can be added by clicking on the button. The Add index dialog will appear:

List of an index in the data modeling tool

Add Index with data modeling tool

The index can be edited by clicking on the button. The Edit index dialog will appear:

Edit index wit data modeling tool

There are five types of indexes that can be added (Clustered, Non clustered, Primary XML, Clustered columnstore, Non clustered columnstore). Only for Clustered and Non clustered index type Unique option can be checked. If the unique option is checked for those two types, all columns in the column grid will be unique also in the Columns tab, the Unique option for those columns will be checked. One exception is the Clustered columnstore index type, which doesn’t have any columns.

Constraints customization

Similarly, as for adding or editing Indexes, Constraints can be customized in the Edit table form, which can be done when adding a new table or editing an existing one. To add a new table, press right mouse click on empty space in the diagram and select Add option from the context menu or editing existing one by pressing right mouse click on the table and selecting the Edit option from the context menu:

Constraints customization

Select Constraints tab for customizing constraints.

Edit table form will open, for customizing constraints select the Constraints tab:

add edit or delete constraints using data modeling tool

When Constraints tab is selected, all existing constraints will be listed, and they can be edited, deleted or created by clicking appropriate buttons.

Add new constraint by clicking button. The Add constraint dialog will appear:

Add constraints

There are four possible constraint types to add:

Check constraint

Check constraint

Name and Condition can be edited in the Add constraint window:

Default constraint

Default constraint

Name and Condition can be edited in the Add constraint window, the selected column will be the column on which default constraint will be defined.

Primary key

primary key

A table can have only one Primary key constraint, and if the Primary key constraint already exists, it can be only edited by changing Index type, or by adding or removing columns for Primary constraint. When Primary constraint is created, the Primary key option in the column tab will be checked for all columns which are selected for Primary key constraint:

Unique key

unique key

All options are the same as for Primary key constraints, but the difference is that there can exist more than one Unique key. For all columns which are selected for a unique key, the Unique option will be checked in columns tab when the Unique key is created.

Column customization

Clicking on Primary key option for selected column, Non clustered primary key constraint is automatically added. If the Primary key already exists, then the selected column will be added to that primary key:

customization columns

Clicking on Unique option for selected column, Non clustered unique constraint and Non clustered unique index is automatically added. If the Primary key already exists, then the selected column will be added to that primary key:

customization columns

Clicking on the Reset button, the table will be reverted to starting state when the window has been opened.

 

December 6, 2019