PDA

View Full Version : clone a sql table and all its content? including input data?


jarmanje
06-17-2007, 05:39 PM
Hello, i've been looking around for a way to clone a sql table and all of its content

is there an sql to do this?

i cannot find it..

Cota
06-18-2007, 06:49 PM
I would try something like this

CREATE TABLE newTableName SELECT * FROM oldTable WHERE 1=1



That will copy the structure and all the data into the new table.