Quick SQL Question...

Discussion in 'MySQL' started by JEP_Dude, Jul 9, 2011.

  1. #1
    How can I quickly delete a number of tables from a SQL DB without specifying the table's name? Does "Delete *" work in SQL as it did in Ms-DOS?

    May you have a Blessed day as the LORD wills ....

    JEP_Dude
     
    JEP_Dude, Jul 9, 2011 IP
  2. webboy

    webboy Peon

    Messages:
    109
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could the SQL Admin manager or the (Web interface) that the best way ( MS DOS ) hahah you kidding right and no DELETE * will not work you need to tell it what db you want it to use and then the tables is you are using it on the shell
    mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [DATABASE]

    if not jump on the server and select them all and drop them or do SHOW TABLES then put the output in a loop in php and drop the tables
     
    webboy, Jul 10, 2011 IP
  3. JEP_Dude

    JEP_Dude Peon

    Messages:
    121
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks.....

    May you have a blessed day as the LORD wills.

    JEP_Dude
     
    JEP_Dude, Jul 10, 2011 IP