Is there an open source SQL Server DB compare tool

2019-01-30 23:33发布

问题:

I'm working on an open source project that uses SQL Server 2005 as the data store. We need a DB compare tool to generate diff scripts to be able to upgrade a DB from one version to another.

Is there an open source or free SQL Server DB diff tool out there that generates a convert script?

回答1:

I think that Open DBiff does a good job. It's simple and I works with SQL Server 2005/2008.

But only generate the change script. Nothing more and nothing less.



回答2:

On CodePlex I noticed yesterday DbDiff (http://www.codeplex.com/OpenDBiff) that you could try. Supports Sql2005 and 2008, I did not try it.



回答3:

I'd recommend spending some cash and getting Red Gate's SQL Compare tool which does an excellent job, and can even compare databases to Visual Studio database projects to generate upgrade scripts. It's fast and easy to use, and works well. The upgrade scripts are also of decent quality.

It's not that expensive. Probably less expensive than your time. Just think about how much your hourly rate is, and how many hours it might take to investigate an open-source tool and get it working (and how many you have already spent), then multiply them together. That's how much a 'free' tool is really costing you, which is often significantly more than a commercial tool.



回答4:

It's not open source, but is free (as in beer): Sql Effects Accord (aka Clarity) Community Edition



回答5:

AdeptSQL Diff and DataDiff are wonderful products, much cheaper than RedGate's and a much more simplified UI, and I have yet to run into a scenario it cannot handle.



回答6:

Aloha

You might want to try SqlDbDiff. It can generate change scripts. The free edition does a good enough job.



回答7:

Anyone try xSQL Bundle (xSQL Data Compare and xSQL Object Compare)? Our place only uses for DB diffs, no syncs, so can't say for syncing but the diff and reports are not bad.

Also, OpenDBDiff has a spin off, not sure which is better - http://code.google.com/p/sql-dbdiff/

Anyone know if any of the free/open source DB diff tools mentioned here offer scriptable / command line interface to automate the diffs and synching?

I looked into xSQL tools, they offer command line access but unfortunately, no scriptable command to export diff results to (report) file.



回答8:

While it's not exactly what you want, I found this for postgres:

http://mbk.projects.postgresql.org/

It doesn't generate a diff to apply, but rather allows you to merge a full dump of the new version of the table with the previous version.



回答9:

Hmm, none that I know of. You can always retrieve the definitions as SQL and then run a diff tool on them, but it's a bit of a pain in the rear.

Probably the best solution for this is using some kind of "Migrations" tool, so you can keep your database definitions together with your code, and version them, etc.



回答10:

Update

On Sourceforge I found Whiz SQL Structure Compare with this description: Whiz is a database diff utility which will be useful to find difference between two MS-SQL Server databases. It also able to generate SQL script to update the changes from one database to another database.

However, I've been unsuccessful in getting it to work so far...



回答11:

We have both SQL Delta and SQL Compare. Each has strengths, but each also have weaknesses that make them quite a pain.

SQL Delta will miss some triggers in its comparison, and it will take actions not found in the action list, and it will sometimes take actions you did not want it to take. That was discovered at quite a cost in time.

SQL Compare will catch the triggers, but they are embedded within the table listings. On a large database, that means going through each table and sifting them out. Something the tool should have isolated for us. Again, quite a cost in time.



回答12:

Its is a little late, but I just relased a real simple project on code plex:

http://dbcompare.codeplex.com

Enter (or build) two connection strings and it will compare all Tables, Views and Stored Procedures.