SQLServer 修改数据库字段类型

Posted 木木

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQLServer 修改数据库字段类型相关的知识,希望对你有一定的参考价值。

 

 

# 修改字段名称为临时字段 exec sp_rename data_config.description, description1,COLUMN;

# 创建新的字段并设置为目标格式
alter table data_config add description text ;
# 把临时字段中的值保存到新字段
update data_config set description = description1;
# 删除临时字段
alter table data_config drop column description1;

 

以上是关于SQLServer 修改数据库字段类型的主要内容,如果未能解决你的问题,请参考以下文章