Trying to do something simple Data Compare in SSDT but proving a bit hard.
In one database, I have two tables I want to compare.
These tables have the same schema, just different table names. And I just want to see if this tool will give me a nice way to compare the data in both.
I.e.
tblOutput
tblOutput_210314
But this picking of two tables to compare against each other in a single database I can't see how to achieve.
Seems like you can only pick a table name which exists in both source and target databases. Since my source and target database is the same, I am basically comparing my table to itself ?
Anyone know of a way to achieve this with Data Compare ?
- Visual Studio 2012
- SQL Server Data Tools
- Data Compare
Data Compare only supports comparing 2 different databases with matching schemas. Unfortunately you can't do what you are looking to with Data Compare. From the help documentation:
A work around for the tool limitation. If you have two tables with columns in common that need to be compared. One solution requires duplicating the database and comparing views.
For this example we have a database called CoffeeTableBooksDatabase with two tables, table_myBooks and table_aFriendsBooks with common columns authors and titles that need to be compared.
Duplicate the database with backup then do a restore:
Create a common view:
Now you can compare both databases by just looking at the views comparison. This is not a recommended solution but it works using the tool and its current limitations.
Another person here with the same issue in SSDT Data Compare. One thing you could do is use the
Spreadsheet Compare 2013 program
to compare the 2 tables in Excel workbook sheets.Not the easiest thing I've ever done, but it is a serviceable way to compare data and write SQL changes. I was able to modify 504 values fairly simply with this method.
Changes:= 7 SKU * 3 Columns * 12 Months * 2 divisions = 504 changes
. It's too bad that VS SSDT cannot compare tables with schema differences.--Spreadsheet Compare 2013 export results with added key fields--
--Spreadsheet Compare results written into SQL Update with NOTEPADD++--