|
Posted by Flemming on 11/27/07 05:18
>>Is there a way to create (an empty) NewTable in SQL with indexes and all
>>from OldTable?
>>
>>Flemming
>>
>
> I usually create my own "config" files, that I use similar to restoring
> from a
> backup. As an example, I'll create a file named OldTable.sql that includes
> the
> SQL commands for creating the table and adding its indexes, and using a
> command
> like this to create the table...
>
> mysql -u username -p database_name < /path/to/OldTable.sql
>
> If I need to create a similar or duplicate table, I can copy that to a
> NewTable.sql file, and edit that with whatever changes I needed. Then add
> that
> one using..
>
> mysql -u username -p database_name < /path/to/NewTable.sql
>
> That way you can duplicate a table design a lot easier.
>
Thank you for another helpful suggestion. I'll keep that in mind and use it
in the future.
Flemming
Navigation:
[Reply to this message]
|