>-----Original Message-----
>From: Jones, Keven [mailto:keven.jo...@ncr.com]
>Sent: Monday, November 09, 2009 11:21 AM
>To: mysql@lists.mysql.com
>Subject: Best way to purge a table
>
>Hi,
>
>I need to get rid of all data in one table of my database. The table just has
>old
>Data that I no longer need. What is the best way to accomplish this?
>
>If I simply drop the table what can I do prior to dropping the table to 
>ensure
>I can recreate the table right after I drop it? I still need the table just 
>not
>The data in it. I'm running out of space.
>
[JS]

CREATE TABLE new_table LIKE old_table;
DROP TABLE old_table;
ALTER TABLE new_table RENAME TO old_table;


>Thank you
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=jschwa...@the-
>infoshop.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to