42

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?

mehdi lotfi
  • 11,194
  • 18
  • 82
  • 128
Guy
  • 65,082
  • 97
  • 254
  • 325

12 Answers12

17

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.

12

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

ila
  • 4,706
  • 7
  • 37
  • 41
  • 1
    This doesn't seem to work on Win7 64bit. – Marc Mar 05 '10 at 20:12
  • It did not work for me on Win7 64bit, but i managed to build it from source (added some missing dlls from Binary distribution, and System.Data.SQLite.DLL from a copy of SubSonic). It took me 5 minutes or so to do. Give it a try - it seems to produce good results (generates a sync script). Have run tested the scripts yet, but the tool looks very promising. – Muxa Jul 24 '10 at 08:50
  • For info, this now works with 64-bit. Just tried it, very good tool. Not quite as good as AdeptSQL Diff, but it's free! – Chris Haines Jan 18 '11 at 10:43
6

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.

Greg Beech
  • 133,383
  • 43
  • 204
  • 250
  • 9
    This argument can be used to justify purchasing EVERYTHING, from Aeron chairs to 40" screens to people who're standing behind you and massage your back. For a small business with no sales yet, which has to purchase many more items, $400 for SQL Compare is simply a waste of funds. Contrast this with Typemock Isolator which costs $90 "For solo developers who work at home", Beyond Compare which costs $30, visualSVN whinc costs $50 - you see my point (all numbers are rounded). They should have made a "personal" version. – Avi Jun 29 '09 at 07:54
  • 1
    He explicitly said he wanted an open source tool or foree tool and did not entirely state why. Maybe even small purchases take months in his organization. Maybe he is doing it for charity for free. Because this is so far from answering his question I downvoted you. – Sqeaky May 02 '12 at 16:41
5

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

Mark Brackett
  • 84,552
  • 17
  • 108
  • 152
4

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.

Wes
  • 711
  • 7
  • 6
3

Aloha

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

edosoft
  • 17,121
  • 25
  • 77
  • 111
  • Freeware version only supports SQL2000. – Lee Aug 14 '10 at 03:32
  • @lee are you sure, I've used it on SQL 2005 boxes. Not sure about sql2008 though – edosoft Aug 14 '10 at 19:33
  • Freeware version wouldn't connect to default SQLEXPRESS instance for SQL2008. Shareware version offers a free trial period and does say it supports 2005 & 2008. I have moved on to Open DBiff for my use. It is not fancy, but it is truely free. – Lee Aug 16 '10 at 19:16
  • The shareware trial is good... the freeware version is not as good as OpenDbDiff imho. – Chris Haines Jan 18 '11 at 10:48
1

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.

David
  • 3,223
  • 3
  • 29
  • 41
1

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.

mkm
  • 1,545
  • 1
  • 14
  • 21
0

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.

0

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.

dguaraglia
  • 5,774
  • 1
  • 26
  • 23
0

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...

Guy
  • 65,082
  • 97
  • 254
  • 325
0

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.

user1054326
  • 318
  • 1
  • 3