October 20, 2021 at 7:40 am
I have a database D1 in Prod and TEST. In Prod D1 has 266 tables and in TEST D1 has 250 tables. How to get the 16 tables that are not in TEST but are there in PROD?
October 20, 2021 at 8:29 am
To get the tables in a database, use sys.Tables:
SELECT Schma = SCHEMA_NAME(t.schema_id), TabName = t.name
FROM sys.tables t;
I'm sure that you can work out the rest by yourself.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
October 20, 2021 at 11:44 am
Or, look at a tool like Redgate SQL Compare. That lived open, and in active use, all day, every day, on my machine until I was hired by the company that builds it.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply