Exclude columns from multiple tables using XML config?

Compares and synchronizes SQL database content.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

Exclude columns from multiple tables using XML config?

Postby freecell1 » Fri Apr 05, 2013 9:35 pm

Hi -

I'm trying to compare two databases and want to exclude columns from multiple tables. I'm using an XML config file with the command line. For one table, this works:

Code: Select all
   <excludecolumns>ResourceStringValue:DateModified</excludecolumns>


But for two columns (one from each of two tables), I can't figure it out. This causes an error:
Code: Select all
   <excludecolumns>ResourceStringValue:DateModified</excludecolumns>
<excludecolumns>Site:Domain</excludecolumns>


as does this:

Code: Select all
   <excludecolumns>ResourceStringValue:DateModified,Site:Domain</excludecolumns>


Thanks in advance.
freecell1
 
Posts: 21
Joined: Tue Mar 13, 2012 8:21 pm

Postby eddie davis » Mon Apr 08, 2013 11:51 am

Hi Freecell1,
Thank you for your forum post.

What version of SQL Data Compare are using?

Looking at the code you included, the syntax looks correct.

A support call has been created for you, the call reference is F0071476. Can you please send an e-mail to support@red-gate.com with details of the error you are experiencing and the full command line syntax you are using. Please include the above call reference in the subject field of the e-mail.

Many Thanks
Eddie
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 942
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software

Postby freecell1 » Mon Apr 08, 2013 3:55 pm

Version: Red Gate SQL Data Compare Command Line Utility V10.0.1.119

Thanks for creating the case. The compare is still not working correctly, although I did get the errors to stop. The syntax that worked better was using two XML tags (middle example above), but I added a RegEx end-of-line match to stop the error:

<excludecolumns>ResourceStringValue:DateModified</excludecolumns>
<excludecolumns>Site$:Domain</excludecolumns>

Without the $, I was getting an error like "no column 'Domain' in table SiteDisplayListItem". I have other tables whose names start with "Site" and the matches are treated as LIKE matches.

So the error code is fixed; however, the comparison still returns differences even if the excluded Domain column is the only one with changes.

Hope to figure this out ...
freecell1
 
Posts: 21
Joined: Tue Mar 13, 2012 8:21 pm

Postby eddie davis » Wed May 08, 2013 3:01 pm

Quick update in case other SQL Data Compare users wish to use the EXCLUDECOLUMNS switch in an XML argument file.

To exclude a column using the xml file, where you have two or more tables whose name includes the same string, the table name needs to be enclosed with the [ ] characters and escaped with the \\ character. Using the example in this forum topic, where you need to exclude the column called "Domain" from a table called "Site" but have other tables whose table name includes the word or characters Site.

Using this syntax - <excludecolumns>\\[Site\\]:Domain</excludecolumns>

Many Thanks
Eddie
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 942
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software


Return to SQL Data Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests

cron