There is a copy of a huge MS Sql Server 2005 database, with more than 1300 tables, plus hundreds of stored procedures and dozens of views, not counting jobs. It is used by several applications.
I need to slim down this monster, leaving only less than 200 tables and 100 stored procedures and other related objects, required by one application to work properly. Of course there is an exact list of tables and stored procedures used by this application, but there is no way to list objects not invoked directly from the code (like jobs, views, triggers, etc).
So there is a question: please advice the best way to accomplish that task. How to securely drop 1000 tables, listing first related objects (like foreign keys, related views and stored procedures, jobs, triggers, etc), and if those objects do not point to other objects required by the application (tables or stored procedures), delete them and then drop the table. The same goes for stored procedures.