Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Generating ALTER TABLE code for MySQL

by liz (Monsignor)
on Oct 21, 2006 at 09:28 UTC ( #579747=note: print w/ replies, xml ) Need Help??

in reply to Generating ALTER TABLE code for MySQL

Version 5.0 of MySQL has:

CREATE TABLE new_tbl LIKE orig_tbl;
Use LIKE to create an empty table based on the definition of another table, including any column attributes and indexes defined in the original table (see ).

Maybe something like that, in combination with a SELECT from the table into the new table, and some table renames, would also be an option?


Comment on Re: Generating ALTER TABLE code for MySQL
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://579747]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2015-11-26 06:11 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls