Dropping MS SQL Tables that have a Prefix using T-SQL


How many times have you wanted to drop a selection of Microsoft SQL Server tables that have begin with some common characters? I have many times especially when I’m testing certain web applications, such as Orchard CMS, and using different database prefix values to switch between instances. Thanks to Curt Hagenlocher over at a StackOverflow post, I now can.

This can easily be updated to include views, stored procedures, and functions.

Nov 16 2012 5:43 PM