简体   繁体   中英

Can i undo ALTER table in - MySQL?

Don't know if it's possible, I Altered VARCHAR column to Decimal Type which i want to Rollback. Because it blended all floating values as integer. like 2.00 became 200. Is there any way to undo my last table Alteration? Please advise.

No, you can't roll back ALTER TABLE statements.

https://dev.mysql.com/doc/refman/5.7/en/cannot-roll-back.html

Some statements cannot be rolled back. In general, these include data definition language (DDL) statements, such as those that create or drop databases, those that create, drop, or alter tables or stored routines.

(emphasis mine)

As Chris Peters comments above, you can do the reverse ALTER TABLE operation, and then clean up your data using UPDATE statements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM