List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:October 15 2002 9:45pm
Subject:Re: Copy table with column attributes
View as plain text  
At 11:10 -0700 10/15/02, David Yee wrote:
>Hi all.  What's the quickest way to copy a table so that all column
>attributes such as auto_increment and primary key along with all indexes get
>copied over?  I like using:
>create table new_table select * from old_table
>But it doesn't copy any indexes or those special attributes I mentioned over
>to the new table.  I know this can be done using mysqldump but I'm wondering
>if there's something quicker (less involved).  Thanks.

mysqldump uses the SHOW CREATE TABLE statement.  Hard to use this output
in a pure SQL environment, but if you issue it from within a program,
you can use the output as you like.


Copy table with column attributesDavid Yee15 Oct
  • Re: Copy table with column attributesInsanely Great16 Oct
Re: Copy table with column attributesPaul DuBois16 Oct