Given two MS SQL databases that are known to have the same schema, how can I determine if they contain identical copies of the data?
I am using MS SQL Server 2008 Express and coding in the C # and v2.0.Net framework using the ADO.NET API. Two database instances reside on the same SQL server.
Background: I wrote software to export data from a database to a set of files and to re-import data from these files (into another copy of the database); I want to check if I lost any data during the round trip (more precisely, if any data was lost or remained during the initial export).
A rough way, in my opinion, would be SELECT * from each table in each database, and then to compare selected recordsets using client-side code. Is there any other way that would require less client code?
I found the documentation on backing up and restoring the database, as well as on selecting and pasting data, but did not notice this on how to check / prove that the two-way trip was completely successful, that is, how to check two copies of the table in two databases data contains equal data.
source share