Straight out of my toolbox:--This script will compare the columns of all tables and views--in the two databases. Returns all columns found in only one database--or columns with a different datatype or datatype max lengthselect table_name, column_name, data_type, character_maximum_length, min(table_catalog) AS DBfrom( select table_catalog, table_name, column_name, data_type, character_maximum_length from db1.information_schema.columnsunion all select table_catalog, table_name, column_name, data_type, character_maximum_length from db2.information_schema.columns)bgroup by table_name, column_name, data_type, character_maximum_length having count(*) = 1
Note: this is designed to compare two databases on the same server, but using linked servers and four-part naming syntax, you could use it to compare databases across servers as well.Owais
Please excuse my driving, I am reloading.