Drop Multiple Tables with Common Prefix (SQL Server)

October 25, 2017 // In: How To

Few days ago, I was working on huge database and I have to remove 80+ database tables with prefix “Temp_” (tables were created during data migration process).

After few minutes of working, I came across the best solution. I found a query  which drops database tables with given prefix by querying information schema table.

I used following Sql Query to delete Tables with prefix “Temp_“.

Replace PrefixHere with your table prefix.

P.S.: Don’t remove % sign after PrefixHere text.


How to Fix WordPress 403 Forbidden Error while Posting
How to Search on Google Efficiently