These pages cover SQL Compare versions 10.0 to 10.4. Help for older versions is also available.

We've released a beta version of the improved migration script feature. We'd love to hear what you think.

Skip to end of metadata
Go to start of metadata

You can use an XML file to specify the arguments for the command line interface. You may want to do this because:

  • An XML file is easier to read than a long and complex command line, particularly where complex rules for including and excluding objects are specified.
  • You can easily transform an XML file into other formats using XSLT.

    For example, you could transform your argument file to HTML for presentation on a Web page.

  • Using an XML file overcomes some limitations that can be a problem when you want to specify regular expressions as command line arguments.

    For example, you may want to use the pipe character ( | ) as part of a regular expression, but it causes problems when it is used at the command prompt; if you use an XML file you can use the pipe character with no problems.

  • Most programming languages support XML, through built-in or freely available third-party libraries.

    This makes it easy to generate and process the XML file.

Create the XML file in the following format:

For example, for the /Include and /Exclude switches, use the following format:

To execute the command line tools using an XML argument file as input, at the command prompt enter:

Icon

When using an XML file

  • you can't specify any other switches on the command line except /verbose or /quiet
  • multiple options should be separated with commas:

Examples

Below are some examples of XML files that can be used with SQL Compare. The command line versions of the examples (using aliases) are also provided for comparison. To migrate changes in the XML examples, use the <synchronize/> element.

Icon
In all these examples, you can use a scripts folder or snapshot in place of a database. Use <scripts1> and <scripts 2> in the XML file for a scripts folder, and <snapshot1> and <snapshot2> for a snapshot. In the command line, replace /db with/scr for a scripts folder or /snp for a snapshot.

To compare all objects in two local databases (Windows authentication):

Using an XML file:

Using the command line:

To compare all objects in databases on different hosts:

Using an XML file:

Using the command line:

To compare all objects in two databases using SQL Server authentication:

Using an XML file:

Using the command line:

To retrieve verbose output of the differences between two databases:

Using an XML file:

Using the command line:

To migrate schema changes from the first database to the second database:

Using an XML file:

Using the command line:

To compare only tables containing the word "Product":

Using an XML file:

Using the command line:

To compare only tables containing the word "Product" except for the "ProductHistory" table:

Using an XML file:

Using the command line:

Scripts folder database information file

When you create a scripts folder, an XML file containing some basic details about the structure of the database is created. The file is called RedGateDatabaseInfo.xml and is stored in the main scripts folder at the top level.

The file contains the following information, with the defaults as shown:

If you have your own set of SQL creation scripts that you want to use in SQL Compare, you can specify the settings for your schema by editing this file. If the file does not exist when you run the comparison, SQL Compare creates it, using the default values.

  • No labels