Save off differences between databases using command line getting NothingToCompareException

AndrewVaheyAndrewVahey Posts: 2 New member
edited September 16, 2020 9:22PM in SQL Data Compare
Hello, 
I'm trying to write a powershell script that compares the data in a list  of tables between our master database and our production databases. I keep getting an error saying "Nothing to compare. Either there are no tables/views that can be compared, or everything has been filtered out". I know that some of the tables are absolutely not the exact same. I'm not really sure what I'm missing. I've read through the documents and I thought I had the table list formatted correctly but I'm still running into issues getting any output. 

$TablesToCheckDefaultData = "\[HierType\]^|\[Hier\]" 

sqldatacompare /server1:PC-ANDREWVAHEY /database1:Tworks_master /server2:DRHSQL2014B /database2:AllStarLabor 
  /export:C:\Users\andrew.vahey\Documents\CompareResults\FastTrackDataCompare.csv
  /Include:table:$TablesToCheckDefaultData

Tagged:

Answers

  • Eddie DEddie D Posts: 1,807 Rose Gold 5
    Hi, thank you for your forum post.

    Do you experience an Exit Code 63 along with the "Nothing to compare" message?

    If yes, can you please add the /Include:Identical switch to your syntax which will suppress the 63 exist code.

    Otherwise, can you add the /LogLevel:Verbose switch to your syntax?  This switch will generate a log file of comparison which may aid fault finding.  You will find the log file in this path:
    C:\Users\<user name>\AppData\Local\Red Gate\Logs\SQL Data Compare

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.