Schema Detailed PDF Print E-mail
Sync For SQLServer - Walkthrough
Friday, 29 June 2007

The first thing you need to do is to connect to your (see figure 1) SQL Server instances which will be your DataSource database. You repeat this step for your Destination database. The DataSource is the reference database. The Destination is the target database which will be updated. After the update the Destination will look in its schema the same as the Data Source. 

Conect
Figure 1: Screenshot Data Connection Properties.

In the Object Explorer tree (see figure 2) you can select "Set as Data Source" or "Set as Destination" to change the roles of the databases in the synchronization process. You can see in the picture which is the master and which is the destination database. 

Object Explorer
Figure 2: Screenshot Object Explorer.

You can select (see figure 3) the database objects you want to have included in the comparison and the resulting change script. 

Options
Figure 3: Screenshot Compare Options.

Click the "Compare" button to run the comparison. The comparison results (see figure 4) gives you an overview of where there are differences. The "=" symbol indicates there are no differences, the "!" sign indicates the object is different in the two databases, and the smaller sign indicates missing objects. If there were a larger sign, it would indicate additional objects. The right half of the screen shows you where there are specific differences in the databases. The difference view is very intuitive like you are used to in WinDiff and it is based on the SQL definition of the objects. 

Difference View
Figure 4: Screenshot comparison results in the Difference View.

The next step is to check if you have to provide some additional information for creating the change scrpt. This is the case if a table in the DataSource database has more table columns as the table in the Destination database. Sync For SQLServer is trying to add this column in your Destination database table. But if this column not allows NULL values you have to specify a default value for this new column. Just open the New Columns Editor (see figure 5).
You can see that there is one row in orange in the New Columns Editor. The DataSource table "HumanRessources.Department" has contains a column named "New Column" which the table "HumanRessources.Department" in the Destination database does not contain. In the text area below "SQL Expression" Sync For SQLServer proposes a default value. The default value can be any scalar SQL expression.
The row is marked in orange because any values you edit in the New Columns Editor are stored in an XML-file in your Workspace. Values from new compare runs which are not contained in this XML-file are highlighted to ensure you enter a default value. 

New Columns Editor
Figure 5: Screenshot New Columns Editor.

The next step is to press the "Create Change Script" button. By clicking you will create the Change Script for synchronizing your database structure. This script can only be applied on your Destination database.
After having your Change Script created it will be opend automatically in an SQL editor (see figure 6). You can review or modify the Change Script. You can start the script from here or take it for some batch jobs. All the scripts can be administered in the workspace explorer (see figure 6). In the Workspace Explorer you can group together scripts for a complete database update. 

Change Script
Figure 6: Screenshot Change Script.

 

Sync For SQLServer allows you to choose what to do with the script. You can either choose to run the script from Sync For SQLServer. You can use the command line to run the script or you can run it with SQL Server. You can choose to synchronize the databases now and then compare the databases after the synchronization to ensure it was a success.

Last Updated ( Sunday, 22 July 2007 )
 
< Prev   Next >
About SleepyAnt Software | Privacy Policy | Terms of Service | Contact Us
Copyright 2005-2007 SleepyAnt Software. All rights reserved unless otherwise stated.
SleepyAnt Software and SleepyAnt Software