'Compare two SQL databases [closed]
I've made a whole bunch of changes on my development machine (table definitions, stored procedures etc). It there a script or a free tool I can run which will find all the differences between development and the live server?
Solution 1:[1]
Short answer is that there is no out of the box script that will tell you the differences between two databases. It can be created using information schema views but it can be quite complex if you really want to compare everything.
I’d recommend you try one of the third party tools mentioned here to get the job done.
I’ve had good success with ApexSQL Diff, especially on large databases but you can’t go wrong with any of the tools mentioned here.
Solution 2:[2]
SQL Compare is not free, but has a 14 day free trial.
Visual Studio has a schema comparison tool too (since 2005).
Solution 3:[3]
SQLDBDiff is available for free: http://www.sqldbtools.com/Default.aspx
Solution 4:[4]
So, googling got you what?
Have a look at Microsoft SQL Server Compare Tools
Solution 5:[5]
Try http://msdn.microsoft.com/en-us/library/ms173453.aspx - uses SSMS 2008 R2.
Solution 6:[6]
Here is a list of comparison tools: http://www.mssqltips.com/sqlservertip/1069/sql-server-comparison-tools/
By the way, for those who want to compare Azure databases with SqlServer databases, the Visual studio 2010 cannot do it. It does not support databases earlier than 2008R2. Also at this moment, VS2012 does not have a comparaison tool. The best tools that can do a data compare/schema compare are the red-gate tools. Hope this helps.
Solution 7:[7]
Following are the three different ways that i have used to compare two SQL databases.
1). You can use visual studio to compare two databases as follows. Got to visual studio and click tools, sql server. you can see there are two options named New data comparison and New schema comparison. You can do what you want.
2). Another one is use RedGate plugin but this is not free. You can use 30 days free trial and you can will be having two databases one is uploaded to the visual studio directory while local DB in your computer. Its like visual studio TFS.
3). You should install MSSCCI(Microsoft Source Code Control Interface) for visual studio team foundation server. Use this article and follow the instructions.
https://www.mssqltips.com/sqlservertip/5049/getting-started-with-source-control-for-sql-server/
Solution 8:[8]
Free version of MssqlMerge can show changes made in table definitions, views, stored procedures and functions (I am the author of this tool).
Solution 9:[9]
Late to the answer area but OpenDBDiff worked for me .
OpenDBDiff - A database comparison tool for Microsoft SQL Server 2005+ that reports schema differences and creates a synchronization script.
github link -https://github.com/OpenDBDiff/OpenDBDiff
portable exe here - https://github.com/OpenDBDiff/OpenDBDiff/releases
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
