List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:November 9 2009 10:36pm
Subject:RE: Best way to purge a table
View as plain text  
>-----Original Message-----
>From: Jones, Keven [mailto:Keven.Jones@stripped]
>Sent: Monday, November 09, 2009 11:21 AM
>To: mysql@stripped
>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=1
>infoshop.com




Thread
Best way to purge a tableKeven Jones9 Nov
  • Re: Best way to purge a tableMikhail Berman9 Nov
  • Re: Best way to purge a tableJohn Daisley9 Nov
  • RE: Best way to purge a tableJerry Schwartz9 Nov