| Author |
MySQL: delete all contents in the db
|
Peter Primrose
Ranch Hand
Joined: Sep 10, 2004
Posts: 755
|
|
does anyone know of any command that clear/delete/remove all the content in the dataase (but do not touch the tables) so the end result will be empty tables. thanks peter
|
 |
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
|
|
In Oracle I use to genrate the script with help of a query. you will have to write script using truncate Shailesh
|
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
|
 |
Peter Primrose
Ranch Hand
Joined: Sep 10, 2004
Posts: 755
|
|
can you show an example of a script you wrote. thanks
|
 |
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
|
|
As I mentioned I did same in Oracle Select TABLE_NAME form user_tables gives me all table in schema so I made a query like select distinct 'Truncate table ' || TABLE_NAME || ';' from USER_TABLES; and I saved the output of query in a sql file Then I could execute sql file on sql plus Shailesh
|
 |
miguel lisboa
Ranch Hand
Joined: Feb 08, 2004
Posts: 1281
|
|
|
see this
|
java amateur
|
 |
 |
|
|
subject: MySQL: delete all contents in the db
|
|
|