I'm feeling a tad lazy... Does anyone know if there is any tool that can compare two databases (and the tables) and allow you to create the SQL necessary to make them identical? I.e. creating new tables, adding columns, etc. etc.
You didn't say what database engine, however if your using SQL Server and you don't mind paying for professional tools I would highly suggest SQL Compare from Red Gate. If you did want to compare data as well Red Gate also do SQL Data Compare. Jen
SELECT t1.id FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL returns you all ids from t1 which couldn't be found in t2.