Comparing tables

SELECT * FROM database1.INFORMATION_SCHEMA.TABLES db1 FULL JOIN database2.INFORMATION_SCHEMA.TABLES db2 on db1.TABLE_NAME = db2.TABLE_NAME WHERE db2.TABLE_NAME IS NULL OR db1.TABLE_NAME IS NULL
This snappet compare two databases and query for the tables that has in diference.

This is very useful when you have diferent versions of a databases.

It works on SQLSERVER

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.