Re: Replicating an existing table

2007-05-23 Thread Brent Baisley
create table x like y Creates an exact copy of the table without the data, indexes are included. - Original Message - From: "J Trahair" <[EMAIL PROTECTED]> To: "MySQL General" Sent: Wednesday, May 23, 2007 3:58 PM Subject: Replicating an existing table H

Re: Replicating an existing table

2007-05-23 Thread Michael Dykman
http://dev.mysql.com/doc/refman/5.0/en/create-table.html under MySQL 5.0 you can do this: CREATE TABLE mynewtable LIKE theotherone; -- this will copy the structure as well as add idexes identical to the plan in the original under any earlier 4.x version, this will work too CREATE TABLE mynewtab

Replicating an existing table

2007-05-23 Thread J Trahair
Hi Everyone Is there a way of replicating or cloning the structure of an existing table and giving it a different name? I have a table of items on sale in the shops, I want to create a table of items not yet in the shops but due to be introduced very soon. MySQL 5.0.37 Windows XP. Thanks in a