Nov
16
2011
So yesterday I needed to delete all the tables in a test database. It had hundreds of tables and I didnt want to write a cursor. Surely MS must have something. A quick Google search later, and Joe Webb had a post that helped me.
Turns out MS has a proc for just such an occassion, sp_MSforeachtable.
EXECUTE sp_MSforeachtable 'DROP TABLE [?]';
and done.