Compare and synchronize scripts folders and static data

A scripts folder is a set of scripts that represent a database schema and table data. It can be used to:

  • Version-control table data
  • Compare table data
  • Compare table data on an unconnected SQL Server

Static data is data that is located at database tables.

With Data Compare, you can create a scripts folder with static data from an existing data source. You can do it in the New Data Comparison wizard when you set up the comparison.

Create a scripts folder with static data

To create a new scripts folder via Data Compare:

1. Click New Data Comparison:

2. In the New Data Comparison wizard, select Scripts Folder from the Type drop-down menu either as a Source or a Target.

3. Click the plus icon shown in the screenshot:

4. In the Create Scripts Folder or Snapshot dialog box that appears, specify a type of the object, you’re creating a scripts folder from, connection, the database name, the output file name, and the folder to save it to.

Note

You can create a scripts folder from a database or another scripts folder.

By default, Data Compare decrypts encrypted objects. If you want to disable this option, click to clear the checkbox next to this option. Enabling this option may result in slower performance.

Note

If you create a scripts folder from another scripts folder; the decryption option is not available.

5. To create static data, select the Include data checkbox under the Path field.

6. To customize the scripts folder structure and file name templates, click the Scripts Folder Structure button. Specify the directories for saving your database objects in the Scripts Folder Structure dialog box.

7. Click Create.

How to compare and synchronize scripts folders in SQL Server

When comparing and synchronizing scripts folders either as the Target or the Source, a synchronization script is created. It can be saved to a file or opened in an internal editor.

When a scripts folder is selected as the Source, you can select to execute the synchronization script directly target database.

When a scripts folder is selected as the Target, you can select to update the scripts folder after synchronization.

Scripts folders synchronization issues

  • We recommend you to enable Ignore spaces in object names and Ignore trailing spaces options when using a scripts folder as a data source. That’s because SQL Server doesn’t always process white space and comments correctly at the beginning and end of the object definition for such objects as views, stored procedures, and rules.

  • When you select a scripts folder as a target data source, comments that are part of a table definition will be lost when the table is modified and the object creation script updated.