How can we help you today? How can we help you today?

Possibilities with SQL Data Compare

I need a tool where I can make an automated process where I:

Compare two tables on a daily basis. They are placed in a separate databases together with a lot of other tables but they do not have the same name. The data structure is almost the same and they have a columns where they can match rows on.

Would that be possible to do with this tool and if yes how would you set this up so you in a command line. You would need to provide the table names. The key columns to match rows on is static so maybe that could be configured in a project?

It looks a bit to me as this tool is mainly designed to compare whole databases, but maybe I am wrong?
Lars Andersen
0

Comments

6 comments

  • Rob C
    Yes, this is possible. The command line syntax and some examples can be found here - https://documentation.red-gate.com/sdc13/using-the-command-line

    You could use the /Include switch to restrict the comparison to specific tables.
    Rob C
    0
  • Laa
    Thanks for the reply, I have looked at the mentioned documentation, but I still have my doubts if it would be possible to compare Table A in DB A with Table B in Database B or do I have to rename table B in Database B to the name table A before I can run the batch?. 
    Laa
    0
  • Rob C
    You can compare tables with different names, but you would need to create a project file that mapped them. You would then use the project file to perform the command line comparison.

    Here's some more info on mappings - https://documentation.red-gate.com/sc13/setting-up-the-comparison/mapping-tables-and-columns
    Rob C
    0
  • Laa
    Ok So I now I found out how to map two tables with different names and save this in a project. The question left is then if it is possible to do the compare command line based with two tables that changes names. So today the table is called TableA_20190111 and TableB_20190111 but the new tables created tomorrow that needs to be compared would be called TableA_20190112 and TableB_20190112. Is this to dynamic to be handled command line based?
    Laa
    0
  • Rob C
    You can't do it directly from the command line, but the project file is xml so you could replace the table name in the file and then run the comparison.
    Rob C
    0
  • sam.blackburn
    There isn't a supported way to do this, but the project file is in an XML format and you could probably craft one with the correct mappings information without too much trouble.
    sam.blackburn
    0

Add comment

Please sign in to leave a comment.