This is a discussion on TRUNCATE TABLE * ? within the MySQL Database forums, part of the Database Forums category; the above does not work. How can I TRUNCATE all tables without having to explicitly specify each one? Thanks....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Herb wrote:
> the above does not work. > > How can I TRUNCATE all tables without having to explicitly specify > each one? Thanks. I don't think this is possible. You can do it programmatically using the answer to SHOW TABLES of course. -- Brian Wakem |
|
|||
|
== Quote from Brian Wakem (no@email.com)'s article
> Herb wrote: > > the above does not work. > > > > How can I TRUNCATE all tables without having to explicitly specify > > each one? Thanks. > I don't think this is possible. > You can do it programmatically using the answer to SHOW TABLES of course. or you can type all of the truncate statements in a text file and then just run the file from the server prompt. for example: truncate tableA; truncate tableB; truncate tableC; all saved in a file called truncateDB.sql so then you login to your server and once on mysql prompt, just run this file. if you add any more table, just add a truncate line to this file for that table. -- POST BY: lark with PHP News Reader |