Modify the column type in a table online

Source: Internet
Author: User
Modify the type of Columns with data online. First, create the table structure. when creating the table, modify the attribute of the corresponding column to insert into t_hp_room_type_2 select * From t_hp_room_type rename t_hp_room_type to role; rename failed to t_hp_room_type; failed, the name of the table referenced in the son table has also passed,
The newly created table is not referenced by the original son. This is a mistake. When using rename, you must first check whether it is the lowest-level table, that is to say, there are no other tables for reference. Here, there are some tables that directly affect business error reporting. ========================================================== ========== The following method is used for select. floor from t_hp_room_type A where. floor is not null alter table t_hp_room_type add column floor22 nvarchar2 (50) Update Character Set floor22 = floor alter table comment drop column flooralter table t_hp_room_type rename column floor22 to floor supplement: Number (8, 2) 6 digits before the decimal point, and 2 digits after the decimal point can only be an integer.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.