Possible Duplicate:
Truncate all tables in a MySQL database in one command?
how to delete all the data from all tables in the database.
Possible Duplicate:
Truncate all tables in a MySQL database in one command?
how to delete all the data from all tables in the database.
use like this,
TRUNCATE `table1`;
TRUNCATE `table2`;
TRUNCATE `table3`;
TRUNCATE `table4`;
If you have scripted creation of empty tables, it may be faster to drop and recreate the database, depending on number of tables. It is less typing for sure :-) -
You have to do it in single statements. You could create a loop, assigning the next table name to a variable and then use dynamic sql to execute the TRUNCATE
statement.