Data compare command line not working for different table names
So running into one wall after another. I have managed to get this to run when both tables have the same name but cannot get it to work when the names are different even when using the /include:different switch. Keeps flagging up 'invalid key - only one can be specified'. When I change the option to identical and change the table names to both the same, it works. What am I missing here?
"C:\Program Files (x86)\Red Gate\SQL Data Compare 14\SQLDataCompare.exe" /s1:svr /s2:svr /db1:redgate_Src /db2:redgate_trg /Include:table /Include:table:tableA^|TableB /IncludeColumns:TableA:\[edition_id\] /ComparisonKeys:TableA:PKDC002RHEditionsDatesSrcIndex /v /Include:DIFFERENT
Annoyingly Redgate Documentation states "However, if there are schema differences between the data sources, for example if two tables have different names, they may not be mapped automatically." Kind of implies that they can be automatically mapped if the names are similar but this is not the case, one character difference at the end and it doesn't match anything.
Unfortunately there is not a way to map tables on the command line; that is why there is the option to use a project file created in the UI on the command line, so you can map in the UI and then use it on the command line.
There are currently no plans to implement this in the command line either, though you may want to create a SQL Compare Uservoice suggestion for it (or vote on one if someone has already done it by the time you see this) so the team can gauge popularity https://redgate.uservoice.com/forums/141379-sql-compare.
You may be able to modify the project file XML programmatically (the mapping portion of the XML seems pretty straightforward) and then use that option on the command line, but that would not be a use case supported by us.
Have you visited our Help Center?