Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to find a good open source tool that simply compares data in a database on one server to a table (of the same schema) on another server. Then I want to generate INSERT statements for the rows that are different, for either the source or destination/target table.

I've tried downloading several tools, and I can't get any of them to work because they all had bugs. I can be more specific with the errors I received if you need me to be.

I've tried:
SqlDiffFramework setup

If there is a manual way to do this, please let me know. My last resort will be to simply write a program that does it.

share|improve this question
Do you really want to insert all of the rows that are different? Even if the key is the same and/or all of the columns are the same except one? Seems like what you might be looking for is MERGE if you're trying to keep two tables in sync (without using replication / mirroring / etc.). – Aaron Bertrand Jan 10 '13 at 18:39
up vote 3 down vote accepted

Is creating a linked server on one of those an option? If so you could probably do this using something similar to the following query (untested):

INSERT INTO Server1.db1.dbo.Table1
SELECT * FROM dbo.Table2
SELECT * FROM Server1.db1.dbo.Table1

If not, then maybe take a look at SQL Server replication

share|improve this answer
Nice Query +! could also take a look at RedGate for that however it's certainly not free. – Zane Jan 10 '13 at 17:17
I'm checking with our DBAs if I can get permissions to add linked servers. Good thought of doing a federated query. – MacGyver Jan 10 '13 at 18:26

I see that you found that TableDiffGui has bugs. Have you tried using TableDiff directly? You might not run into the same problems.

share|improve this answer
no, I have not tried that yet. – MacGyver Jan 10 '13 at 18:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.