List:General Discussion« Previous MessageNext Message »
From:Hannes Niedner Date:July 4 2001 5:22pm
Subject:Re: Copy table structure to another database?
View as plain text  
When I need recreate a table structure I do it like

CREATE db_target.table_copy
SELECT * FROM db_source.table
WHERE 1=0;

The only thing that you have to do now is

DESCRIBE db_target.table_copy;
DESCRIBE db_source.table;

Since you need to manually  reestablish the indices in the new table.

Although there might well be smarter methods out there.

Hannes

On 7/4/01 8:19 AM, "Graham Nichols" <graham@stripped> wrote:

> Hi,
> 
> Can I copy a table (structure only) to another database? I've searched
> though my manuals without success so far.
> 
> kind regards,  Graham
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>  http://www.mysql.com/manual.php   (the manual)
>  http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <mysql-thread78388@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-hannes.niedner=gmx.net@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

Thread
Copy table structure to another database?Graham Nichols4 Jul
  • Re: Copy table structure to another database?Ilya Martynov4 Jul
  • Re: Copy table structure to another database?Hannes Niedner4 Jul
  • RE: Copy table structure to another database?Don Read4 Jul
  • Re: Copy table structure to another database?Werner Stuerenburg4 Jul