You are here: Re: How do I copy a table for backup and restore purposes « PHP SQL « IT news, forums, messages
Re: How do I copy a table for backup and restore purposes

Posted by Flemming on 11/22/07 21:21

> You can try with the following SQL statement:
>
> CREATE TABLE backuptable SELECT * FROM table_to_backup
>

Thank you for that suggestion. It works and creates a nice copy of all data
in a similar table.

However, it does not copy the index. Maybe there is an equally elegant way
to ensure that the index is copied as well? Or maybe I don't need it if I do
the restore by the following SQL statements:

TRUNCATE TABLE table_to_backup
INSERT INTO table_to_backup SELECT * FROM backuptable

Any suggestions as to whether this will work?

Regards

Flemming

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация