SQL Data Compare - 9.0
Working with scripts folders - SQL Data Compare
A scripts folder is a set of object creation scripts representing a database's schema and (optionally) data.
In SQL Data Compare you can create a scripts folder from an existing data source when you set up the comparison. An object creation script file is created for each object, and different object types are stored within subfolders you can specify.
When you synchronize to a scripts folder, static data files are created.
You can use scripts folders:
- for version control of databases
For example, you may want to store the script files in a source control system, so that you can track the modified or new objects.
- to compare databases on unconnected SQL Servers
You can create and compare scripts folders only if you are using SQL Data Compare Professional Edition.
For an example using scripts folders, see Deploying a database from source control
What's stored in a scripts folder?
- Object creation scripts
A .sql file containing creation scripts is saved for each object in the schema when the scripts folder is created.
- Static data scripts (optional)
A .sql file containing INSERT scripts is saved for each table when you synchronize to the scripts folder.
- Database and schema metadata
A .sdcs file is saved for each table when you synchronize to the scripts folder. These files contain index information that enables SQL Data Compare to compare static data.
The file RedGateDatabaseInfo.xml contains information about the objects in the schema, the SQL Server version, and the collation of the database from which the scripts folder was created.
You are recommended not to delete or modify these files.
Creating a scripts folder
To create a scripts folder:
- On the Data Sources tab of the Project Configuration dialog box, select a database, backup, or existing valid scripts folder as the source.
- Under Target, select Scripts folder.
- In the Scripts folder box, Browse to or select the folder you want to use.
If the folder does not contain valid scripts folder metadata, the option to create schema scripts is enabled.
- Click Create Schema Scripts.
The Create New Scripts Folder dialog box is displayed:

- Under Data source details, specify the details of the source for the scripts folder.
You can create a scripts folder from a database, backup, snapshot, or another scripts folder.
- Under Scripts folder properties, specify a name and location for the scripts folder.
SQL Data Compare automatically detects the case sensitivity of the data source. If you want to override this, clear the Auto detect case sensitivity check box, and select the Treat items as case sensitive check box if required.
By default, SQL Data Compare decrypts text objects in SQL Server 2008 and SQL Server 2005 databases that were created using the WITH ENCRYPTION option. When comparing large databases, selecting this option can result in slower performance.
You can customize the folder structure and character encoding of the scripts folder. To do this, click Scripts creation options. The Edit Scripts Creation Options dialog box is displayed, allowing you to specify the directories in which your database objects and static data are saved.
Note that:
- when the source is a snapshot, the case sensitivity and decryption options are not available
- when the source is a scripts folder, the decryption option is not available
Comparing and synchronizing scripts folders
You can:
- compare a scripts folder with another data source
- synchronize a scripts folder
When a scripts folder is the target, you can either:
- Create a synchronization script to update the database from which the scripts folder was created, or
- Update files in the scripts folder directly
Note that when an object is dropped during synchronization, its script file is not deleted.
If a scripts folder is the target, and any of the script files that will be modified are designated as read-only, a warning is displayed. If you click Yes to continue, these files will be made writable so that they can be modified. This may occur, for example, when you are working with a source control system that sets files to read-only status in some situations.
For more information, see Using the Synchronization wizard
More information about scripts folders
This section provides further information about using scripts folders as a data source in SQL Data Compare.
- White space
SQL Server does not always process white space and comments correctly at the beginning and end of the object definition for some objects such as views, stored procedures, and rules. You are therefore recommended to select both the Ignore spaces in object names and Trim trailing spaces options when you use a scripts folder as a data source.
For more information, see Setting project options
- Comments
When you select a scripts folder as the target data source, SQL Data Compare preserves comments in object types such as views and stored procedures. However, this is not possible for non-textual object types such as tables. Comments that are part of a table definition will be lost when the table is modified and the object creation script updated.
See also |
Was this article helpful?
SQL Data Compare
- Logging and log files
- Internal Connection Fatal Error in versions 4 and 5
- NULL textptr passed to UPDATETEXT function when running synchronization
- How much free hard disk space is required?
- Comparing the data of two tables in the same database
- Suggestions to combat comparison and synchronization performance issues
- SQL comparison and synchronization automation capabilities
- SqlNullValueException occurring in synchronization wizard
- SQL Data Compare command-line XML argument file examples
- Using Windows authentication logons between domains
- Using a filter on a column on related (joined) tables
- Determining minimum database permissions for SQL Data Compare
- Tables with compound keys may not be mapped automatically
- Best practices for synchronizing data
- Cleaning up a SQL script after SQL Compare or SQL Data Compare
- Troubleshooting System.OutOfMemoryException during comparison
- Exception thrown by db reader 1
- Reseed applying "incorrect" identity values
- Running migration scripts using SqlCmd.exe
- This SQL Server has been optimized for x concurrent queries.
- SQL Data Compare showing differences in 2 identical databases
- How to force SQL Compare and SQL Data Compare to use an Encrypted Connection
- Improving the performance of SQL Data Compare
- Logging and log files
- Case-sensitive comparisons
- Tables or views that could not be compared
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Data Compare
- Activating your products
- Activating your products
- Getting help offline
- Getting better performance out of SQL Data Compare
- Release notes - version 10.xx
- SQL Data Compare release notes - version 7.xx
- SQL Data Compare release notes - version 8xx
- SQL Data Compare release notes - version 9.xx
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Using SQL Data Compare