Is there a way to compare specific tables in different databases using a list?

The databases being compared have thousands of tables.  I only need to compare a specific set ( several hundred)  - an input filter list would help greatly.  Is there a way to do this in SQL Compare?
Tagged:

Answers

  • Sam_TouraySam_Touray Posts: 2 New member
    edited June 18, 2020 3:34PM
    In Redgate SQL Compare, go to the "Actions" menu and click "Filter setup pane". This will allow you to configure it to just compare the specific tables you want. To start off with, configure it to only include two of your tables, then click on the floppy disk icon: "Save the current filter". Once you've saved this, you can then open the and view the format of filter file that is created. After you've familiarised yourself with the syntax of this file you can generate your list of tables and insert it into the filter file at the appropriate location e.g.:
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <!--
    SQL Compare
    SQL Compare
    Version:14.2.16.16006-->
    <NamedFilter version="1" type="SQLCompareFilter">
      <!--This filter can be loaded using the SQL Compare UI or used with a SQL Compare command line session using the /filter switch-->
      <FilterName>Filter</FilterName>
      <Filter version="1" type="DifferenceFilter">
        <FilterCaseSensitive>False</FilterCaseSensitive>
        <Filters version="1">
          ...
          <Table version="1">
            <Include>True</Include>
            <Expression>((@NAME = 'TableA') AND (@NAME = 'TableB'))</Expression>
          </Table>
          ...
        </Filters>
      </Filter>
    </NamedFilter>
  • FrankWhitlockFrankWhitlock Posts: 2 New member
    Is there an additional step?  It does not appear to save the .scpf file with the 2 tables I selected.  I went ahead and created a new scpf file that appears in the drop down for the filters.  Regardless of the file or refresh, the compare view does not change - all the tables in the DBs are still displayed.  Using SQL Compare 14.
  • Sam_TouraySam_Touray Posts: 2 New member
    Are you able to post the content of your .scpf file (make sure you redact your table names)?
  • Hi @FrankWhitlock

    If you would like I can reach out to you via a support ticket and we can go through the process of setting up a Filter file as Sam has suggested

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

Sign In or Register to comment.