改变表 [英] Alter Table
问题描述
我有一个大约500演出的表,需要将列数据类型从char(1)更改为varchar(10)。
I have a table of around 500 gigs and need to change the column data type from char(1) to varchar(10).
很明显,alter table语句将花费大量时间来执行。该过程是否会加快过程
It is obvious the alter table statement will take a lot of time to execute. Will the process speed up the process
a)创建具有所需数据类型的表varchar(10)
a) Create the table with the required data type varchar(10)
b)插入select语句
b) insert select statements
任何建议
问候,
kccrga
-kccrga
推荐答案
嗨kccrga,
Hi kccrga ,
我想只是修改列会比创建新表然后插入数据更快。
I guess just modifying the column would be faster than creating a new table and then inserting the data.
因为500演出,所以需要花费很多时间来分配记忆中的空间。
Because for 500 gigs , it will take a lot of time to allocate space in memory.
谢谢
请如果它解决了您的查询,则作为答案。
Please mart as answer if it resolves your query.
这篇关于改变表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!