Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need drop table syntax

Status
Not open for further replies.

bonosa

Programmer
May 19, 2004
76
US
I want to drop all tables that are like: *******_abc_*****

ie have the substring _abc_ in the table name. I couldnt find the syntax to do this.
Thanks,
sb
 
To the best of my knowledge, the functionality of dropping tables by wildcard does not exist in MySQL.

What I've done in the past is to write a script which connects to the server, selects the appropriate database, perform a SHOW TABLES query, then use the appropriate tablenames returned to issue a set of DROP TABLE queries back to the same server.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks much. Your idea works great!
sb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top