Compare tables on 2 db sqlserver I have SQL Server with 2 databases.

I want to compare them and see which tables are on the first database and not on the second database.

Only the names of tables matter, I don't care about the values in those tables.

How can I do it?
Tables in db1 that don't exist in db2:

SELECT name FROM db1.sys.tables
EXCEPT
SELECT name FROM db2.sys.tables
ORDER BY name;


For more elaborate comparisons (like columns, indexes, and data types), don't re-invent the wheel, as there are already tools that solve this problem.* For more info on this in general, see this blog post from ages ago.

Disclaimer: I work for SentryOne.