dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: Easy One-Step Process to Rename a Table in MySQL

Learn an easy one-step process for renaming a table in MySQL.


advertisement

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


During the development lifecycle, we may decide on a name for a table and later want to rename it based on the usage of the table.

Let's assume that there is a TABLE with name TransportType and the new name has been identified as TransportTypes (observe the extra "s" in the name), it is tedious to create a new table, copy all the records and delete the old table.

MySQL has a one step process to rename tables.

RENAME TABLE oldTableName TO newTableName

Following our example, it would look like:

RENAME TABLE TransportType to TransportTypes

 

Visit the DevX Tip Bank

 





   
Sridhar M S. is a Java developer from Bangalore, India. He holds a master's degree in Computer Science.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date