SQL Data Compare - Exclude Rowguid From Comparison

lc6529lc6529 Posts: 30
Getting Closer.

I have setup an XML Argument file to compare two tables on two different servers and put the output of the comparison into a log file.

The tables are identical except for 2 things.

#1: The table on server 1 has a job run against it that will delete all data from the table and repopulate it.

#2: The table on server 2 is replicated out using MERGE replication to servers in different countries.

The table on server 2 would have issues if it were blank, so my XML simply adds new records or updates existing records. All was going fine in testing until we added replication to the mix. Now SQLDataCompare is not working due to the ROWGUID column.

I tried using <excludecolumns>rowguid</excludecolumns>

But that did not work

How do I exclude this column in my comparison?

Here is a sample of my XML. Is this correct?

<!-- Compare These Tables -->
<include>Table:\[Critical_Tables\]</include>
<!-- Exclude This Column -->
<excludecolumns>rowguid</excludecolumns>
<!-- Do These Comparisons -->
<include>Identical</include>
<include>Missing</include>
<include>Different</include>
<synchronize/>

Update:

I have gotten further, I have found out that this syntax works:

<excludecolumns>\[Critical_Tables\]:rowguid</excludecolumns>

However I get "object not set to a reference" when I run my program from the command line using the XML file.

I should point out that rowguid is ONLY in the table on the 2nd server and not in the table on the 1st server.
Sign In or Register to comment.