Exclude columns from multiple tables using XML config?

freecell1freecell1 Posts: 33
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:
<excludecolumns>ResourceStringValue:DateModified</excludecolumns>

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

as does this:
<excludecolumns>ResourceStringValue:DateModified,Site:Domain</excludecolumns>

Thanks in advance.

Comments

  • Eddie DEddie D Posts: 1,802 Rose Gold 5
    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
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • 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 ...
  • Eddie DEddie D Posts: 1,802 Rose Gold 5
    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
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.