SQL Data Compare 5   

Selecting Tables with Unrelated Names

See Also

This example illustrates how you select a number of individual tables for comparison when their names are not related in any way.

In this example, the databases contain the following tables:

You are interested only in the differences between the Product, Customer, Order, and Invoice tables in two different versions of your database, Customers1 and Customers2; you are not interested in any of the other tables, or any views in the databases.

Using the command line

To specify the list of tables to include, you use the /include switch. You could use an include switch for each table that you want to compare. However, this could get unwieldy if you have a long list of tables. Instead, you can use the pipe character ( | ) to separate the table names:

SQLDataCompare /db1:Customers1 /db2:Customers2 /include:table

               /include:table:\[Product\]^|Customer^|Order^|Invoice

where:

Using XML

You can use XML as follows:

<?xml version="1.0"?>
<commandline>
    <database1>Customers1</database1>
    <database2>Customers2</database2>
    <sync/>
    <include>Table</include>
    <include>Table:\[Product\]|Customer|Order|Invoice</include>
</commandline>

Note that the pipe character ( | ) (and other operating system operators) do not have to be escaped by the caret character ( ^ ) when they are specified in the XML file.

To execute the comparison using the XML file, enter the following command:

SQLDataCompare /argfile:XMLfilename.xml

where XMLfilename is the name of the XML file.

 

 

 


© Red Gate Software Ltd 2007. All Rights Reserved.