DatabasesCompare Two Sql Databases

Late one but hopefully useful. Even though chama asked for SQL solutions I’d still recommend using a third party tools such as or tools from Red Gate Joe already mentioned (I’ve used both and they worked great). Reason is that query for comparing two tables using information schema has to be quite complex in order to catch all differences. Note that all of the examples mentioned here only cover columns but none of the queries shown here will show the difference between nvarchar(20) and nvarchar(50) or difference in foreign keys or indexes. Short answer is yes – this is possible using information schema views but it can be rather complex if you want to compare every detail in those two tables. Try the information_schema. Eg: select * from db1.information_schema.columns col1 join db2.information_schema.columns col2 on col1.table_catalog = col2.table_catalog and col1.table_schema = col2.table_schema and col1.column_name = col2.column_name.

Ms Sql Server Compare Databases

Compare database structure: DBComparer is a professional database comparison tool for analyzing the differences in Microsoft SQL Server 2008 (and 2005) database structures. It is an excellent tool for any project development team or DBA managing multiple copies of the same database on an SQL Server.

Compare Two Databases Sql Server 2014

The information_schema simplifies sticking together the information from all the sys.columns,sys.objects etc. It exists automatically in your DB. I think its actually an ISO standard thing, so should work on various DB systems.