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

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

[{'answer_id': 22833, 'author': 'Mark Brackett', 'author_id': 2199, 'author_profile': 'https://Stackoverflow.com/users/2199', 'pm_score': 3, 'selected': False, 'text': '<p>It\'s not open source, but is free (as in beer): <a href="http://www.sqleffects.com/Articles/Product/sqlAccordInfo/aboutSqlAccordCommunityEd.html" rel="noreferrer">Sql Effects Accord (aka Clarity) Community Edition</a></p>\n'}, {'answer_id': 22899, 'author': 'dguaraglia', 'author_id': 2384, 'author_profile': 'https://Stackoverflow.com/users/2384', 'pm_score': 0, 'selected': False, 'text': '<p>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.</p>\n\n<p>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.</p>\n'}, {'answer_id': 24482, 'author': 'Guy', 'author_id': 1463, 'author_profile': 'https://Stackoverflow.com/users/1463', 'pm_score': 0, 'selected': False, 'text': '<p>Update</p>\n\n<p>On Sourceforge I found <a href="http://sourceforge.net/projects/whiz/" rel="nofollow noreferrer">Whiz SQL Structure Compare</a> 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.</p>\n\n<p>However, I\'ve been unsuccessful in getting it to work so far...</p>\n'}, {'answer_id': 284627, 'author': 'ila', 'author_id': 1178, 'author_profile': 'https://Stackoverflow.com/users/1178', 'pm_score': 4, 'selected': False, 'text': '<p>On CodePlex I noticed yesterday <strong>DbDiff</strong> (<a href="http://www.codeplex.com/OpenDBiff" rel="noreferrer">http://www.codeplex.com/OpenDBiff</a>) that you could try. Supports Sql2005 and 2008, I did not try it.</p>\n'}, {'answer_id': 284754, 'author': 'Greg Beech', 'author_id': 13552, 'author_profile': 'https://Stackoverflow.com/users/13552', 'pm_score': 3, 'selected': False, 'text': '<p>I\'d recommend spending some cash and getting <a href="http://www.red-gate.com/products/SQL_Compare/index.htm" rel="noreferrer">Red Gate\'s SQL Compare</a> 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.</p>\n\n<p>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.</p>\n'}, {'answer_id': 374415, 'author': 'edosoft', 'author_id': 6399, 'author_profile': 'https://Stackoverflow.com/users/6399', 'pm_score': 2, 'selected': False, 'text': '<p>Aloha</p>\n\n<p>You might want to try <a href="http://www.sqldbtools.com/Tools.aspx?ProductId=1" rel="nofollow noreferrer">SqlDbDiff</a>. It can generate change scripts. The free edition does a good enough job.</p>\n'}, {'answer_id': 546633, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 5, 'selected': True, 'text': "<p>I think that Open DBiff does a good job.\nIt's simple and I works with SQL Server 2005/2008.</p>\n\n<p>But only generate the change script. Nothing more and nothing less.</p>\n"}, {'answer_id': 1079746, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>We have both SQL Delta and SQL Compare. Each has strengths, but each also have weaknesses that make them quite a pain.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n'}, {'answer_id': 1632426, 'author': 'Wes', 'author_id': 197523, 'author_profile': 'https://Stackoverflow.com/users/197523', 'pm_score': 2, 'selected': False, 'text': "<p>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.</p>\n"}, {'answer_id': 4120516, 'author': 'David', 'author_id': 425997, 'author_profile': 'https://Stackoverflow.com/users/425997', 'pm_score': 1, 'selected': False, 'text': '<p>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.</p>\n\n<p>Also, OpenDBDiff has a spin off, not sure which is better - <a href="http://code.google.com/p/sql-dbdiff/" rel="nofollow">http://code.google.com/p/sql-dbdiff/</a></p>\n\n<p>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?</p>\n\n<p>I looked into xSQL tools, they offer command line access but unfortunately, no scriptable command to export diff results to (report) file.</p>\n'}, {'answer_id': 4312536, 'author': 'mkm', 'author_id': 246621, 'author_profile': 'https://Stackoverflow.com/users/246621', 'pm_score': 1, 'selected': False, 'text': '<p>While it\'s not exactly what you want, I found this for postgres:</p>\n\n<p><a href="http://mbk.projects.postgresql.org/" rel="nofollow">http://mbk.projects.postgresql.org/</a></p>\n\n<p>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.</p>\n'}, {'answer_id': 9472118, 'author': 'user1054326', 'author_id': 1054326, 'author_profile': 'https://Stackoverflow.com/users/1054326', 'pm_score': 0, 'selected': False, 'text': '<p>Its is a little late, but I just relased a real simple project on code plex:</p>\n\n<p><a href="http://dbcompare.codeplex.com" rel="nofollow">http://dbcompare.codeplex.com</a></p>\n\n<p>Enter (or build) two connection strings and it will compare all Tables, Views and Stored Procedures.</p>\n'}]
['https://Stackoverflow.com/questions/22792', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1463/']