Thursday, January 21, 2010

Rename multiple tables in MySQL

DROP TABLE IF EXISTS tbl_test;
CREATE TABLE tbl_test(a int, b int);
DROP TABLE IF EXISTS tbl_test2;
CREATE TABLE tbl_test2(a int, b int);
RENAME TABLE
tbl_test TO tbl_test1,
tbl_test2 TO tbl_test3;

No comments:

Post a Comment