Sql Server 2005: Drop all tables in a schema, then the schema too
Posted on 2009-04-27
I want to cleanup a database that has several schemas that are no longer used. I would like to get rid of them and free up some disk space. What is the best way to do this?
For example, I have a database called XYZ. Under XYZ there are several schemas such as DEV, TEST, USERDATA or whatever.
Then, under each schema, there are tables that are all identical such as:
I would like to remove/drop/delete DEV, TEST and USERDATA so that all the tables, objects, data get deleted returning disk space to the server.
Should I use Management Studio or a script?