I am looking to have a small test that I can run to compare two separate databases that could be almost identical in table structures.
Here is what I'm looking at...
MSSQLSERVER (Instance)
|
|-- MY_DB1
|
|-- Table_A
|-- Column_Foo
|-- Column_Boo
|-- MY_DB2
|
|-- Table_A
|-- Column_Foo
|-- Column_WTF
|-- Column_Boo
Excuse the crude diagram above, this was just to illustrate the idea. As you can see we have a SQL Server instance MSSQLSERVER
and it has two separate restored databases. Both of these databases have multiple database tables. I need this test to compare both MY_DB1
and MY_DB2
databases and show me a list of any tables that have different columns.
Based on above example, the output would indicate:
MY_DB2
|
|-- Table_A
|-- Column_WTF
It would show Column_WTF
because this was not found in the MY_DB1
.
I always need to know if the columns are a 100% match, if they are not then it should provide output that would indicate where the differences are.
I would like to do this with T-SQL, but I'm also open to any opensource tools that may already have this functionality for simple comparison.
Thanks for any help.