How to create a filter for command line comparisons How to create a filter for command line comparisons

How to create a filter for command line comparisons

You can create a filter for command line comparisions by opening a new project in the SQL Compare UI. You can then run a comparison on any two DBs (source and target). It doesn't matter which Databases you are comparing because you're only interested in setting up a new filter.

Once you have run the initial comparison click on 'Custom filter rules':

mceclip0.png

You can then set up the filter by entering the objects that you would like to exclude or include:

mceclip1.png

Once configured click OK and then click on the save icon just above 'Custom filter rules':

mceclip2.png

mceclip4.png

You should now have a filter file (.scpf) that you can include in your command. Here is an example of how to include the .scpf file in your command:

SQLCompare.exe /s1:Server1 /db1:DB1 /s2:Server2 /db2:DB2 /filter:C:\filters\AbdulsFilter.scpf

Please note that the switch/filter is not available for SQLDataCompare.exe.

Related documentation:

Using Filters

Using the command line