Required license: Professional or Enterprise
SQL Server is a relational database management system developed by Microsoft.
The SQL Server data connector can be used to connect to your SQL Server data.
You can also use the SQL Server data connector to connect to an Azure SQL database.
Required SQL Server configuration
Set up the database users, authentication and recovery model for SQL Server
Configure workspace data connections
Data connection settings for SQL Server workspaces
Out of the box, Tonic Structural supports SQL Auth login.
To use Structural, your SQL Server Admin must enable SQL Auth login.
The following is an example of how to create a new user, called tonic
, and grant necessary permissions.
For the source database, we recommend that you use a backup of your production database instead of connecting directly to your production environment.
The following statements create a new database user called tonic
that has the SELECT
, VIEW
DATABASE STATE
, and VIEW ANY DEFINITION
grants.
Structural does not create the destination database during data generation. Instead, you must set up the destination database before you generate data.
The destination database must resemble the source database as much as possible. We strongly recommend that you run the CREATE DATABASE
and ALTER DATABASE
statements exactly as they were written for the source database. For example, if your source database contains filegroups, then for Structural to run successfully, you must also create filegroups on the destination database.
Creating the destination database is a one-time step. Once the destination database is created, Structural can successfully update it, including schema-level objects, between generation runs.
The destination database requires a higher level of permissions than the source database.
For ease of use, we recommend that you create a user with the db_owner
role.
To maximize performance, we suggest that you run your destination database with a Simple recovery model. This reduces transactional logging and improves the performance of writes to the destination database during generation runs.
To set this in SQL Server Management Studio:
Right-click the destination database.
From the context menu, select Properties.
Select the Options sub-menu.
From the Recovery Model drop-down, select Simple.
By default, during each data generation job, Structural creates the database schema for the destination database tables, then populates the database tables based on the workspace configuration.
If you prefer to manage the destination database schema yourself, then set the environment setting TONIC_SQL_SERVER_SKIP_CREATE_DB
to true
. You can configure TONIC_SQL_SERVER_SKIP_CREATE_DB
from the Environment Settings tab on Tonic Settings.
When TONIC_SQL_SERVER_SKIP_CREATE_DB
is true
, then Structural does not create the destination database schema. It deletes the data from the destination database tables, except in the following cases:
Tables that use Preserve Destination or Incremental mode
Upsert data generation
It then populates the tables with the new destination data.
Tonic Structural supports SQL Server versions 2014 and higher.
During workspace creation, under Connection Type, click SQL Server.
In the Source Settings section, provide the details about the source database.
To provide the connection details for the source database:
In the Server field, provide the server where the database is located.
In the Database field, provide the name of the database.
In the Port field, provide the port to use to connect to the database.
In the Username field, provide the username for the account to use to connect to the database.
In the Password field, provide the password for the specified username.
To test the connection to the source data, click Test Source Connection.
To configure SSL authentication for the source database:
By default, SSL is enabled, and Enable SSL/TLS is in the on position. We strongly recommend that you do not turn off SSL.
To use Kerberos or NTLM authentication:
Toggle Integrated Security to the on position.
For Kerberos authentication, in the Kerberos Domain field, provide the Kerberos domain. For NTLM authentication, leave the field empty.
To indicate that Tonic Structural should trust the server certificate, toggle Trust Server Certificate to the on position.
To connect to an SSH bastion for additional security:
Toggle Enable SSH Tunnel to the on position.
In the SSH Host field, provide the host for the SSH bastion.
In the SSH Port field, provide the port for the SSH bastion.
In the SSH User field, provide the name of the user to use to connect to the SSH bastion.
If you do not use a private key, then in the SSH Passphrase field, provide the passphrase to use for authentication.
If you do use a private key, then in the SSH Private Key field, provide the private key. If the private key uses a passphrase, then in the SSH Passphrase field, provide the passphrase for the private key.
To enable MultiSubnetFailover for the source database, toggle Enable MultiSubnetFailover to the on position.
By default, data generation is not blocked as long as schema changes do not conflict with your workspace configuration.
To block data generation when there are any schema changes, regardless of whether they conflict with your workspace configuration, toggle Block data generation on schema changes to the on position.
SQL Server supports the upsert process. When you enable upsert for the workspace, the data generation process initially writes the transformed data to an intermediate database.
After the initial data generation is complete, the upsert job writes new records to the destination database, and updates existing records in the destination database. It does not touch any other records that are in the destination database.
In the Upsert section, when you enable upsert, you are prompted to configure the upsert processing and to provide the connection information for the intermediate database.
If the intermediate database is in the same location as the source database, then you can copy the connection and authentication details from the source database.
To copy the connection and authentication details from the source database:
Click Copy Settings from Source.
In the Password field, provide the password.
To test the connection to the intermediate database, click Test Intermediate Connection.
To provide the connection details for the intermediate database:
In the Server field, provide the server where the database is located.
In the Database field, provide the name of the database.
In the Port field, provide the port to use to connect to the database.
In the Username field, provide the username for the account to use to connect to the database.
In the Password field, provide the password for the specified username.
To test the connection to the source data, click Test Intermediate Connection.
To configure SSL authentication for the intermediate database:
By default, SSL is enabled, and Enable SSL/TLS is in the on position. We strongly recommend that you do not turn off SSL.
To use Kerberos or NTLM authentication:
Toggle Integrated Security to the on position.
For Kerberos authentication, in the Kerberos Domain field, provide the Kerberos domain. For NTLM authentication, leave the field empty.
To indicate that Structural should trust the server certificate, toggle Trust Server Certificate to the on position.
To connect to an SSH bastion for additional security:
Toggle Enable SSH Tunnel to the on position.
In the SSH Host field, provide the host for the SSH bastion.
In the SSH Port field, provide the port for the SSH bastion.
In the SSH User field, provide the name of the user to use to connect to the SSH bastion.
If you do not use a private key, then in the SSH Passphrase field, provide the passphrase to use for authentication.
If you do use a private key, then in the SSH Private Key field, provide the private key. If the private key uses a passphrase, then in the SSH Passphrase field, provide the passphrase for the private key.
To enable MultiSubnetFailover for the intermediate database, toggle Enable MultiSubnetFailover to the on position.
For a SQL Server workspace, you can write the destination data to either:
A destination database server.
A Tonic Ephemeral snapshot. For more information, go to Writing data generation output to a Tonic Ephemeral snapshot.
Under Destination Settings, to write the transformed data to a destination database on a database server, click Database Server.
To copy the connection and authentication details from the source database:
Click Copy Settings from Source.
In the Password field, provide the password.
To test the connection to the destination database, click Test Destination Connection.
If you do not copy the source connection details, then to configure the connection to the destination database:
In the Server field, provide the server where the database is located.
In the Database field, provide the name of the database.
In the Port field, provide the port to use to connect to the database.
In the Username field, provide the username for the account to use to connect to the database.
In the Password field, provide the password for the specified username.
To test the connection to the destination data, click Test Destination Connection.
To configure the SSL authentication for the destination database:
By default, SSL is enabled, and Enable SSL/TLS is in the on position. We strongly recommend that you do not turn off SSL.
To use Kerberos or NTLM authentication:
Toggle Integrated Security to the on position.
For Kerberos authentication, in the Kerberos Domain field, provide the name of the Kerberos domain. For NTLM authentication, leave the field empty.
To indicate that Structural should trust the server certificate, toggle Trust Server Certificate to the on position.
To connect to an SSH bastion for additional security:
Toggle Enable SSH Tunnel to the on position.
In the SSH Host field, provide the host for the SSH bastion.
In the SSH Port field, provide the port for the SSH bastion.
In the SSH User field, provide the name of the user to use to connect to the SSH bastion.
If you do not use a private key, then in the SSH Passphrase field, provide the passphrase to use for authentication.
If you do use a private key, then in the SSH Private Key field, provide the private key. If the private key uses a passphrase, then in the SSH Passphrase field, provide the passphrase for the private key.
To enable MultiSubnetFailover for the destination database, toggle Enable MultiSubnetFailover to the on position.