本文介绍了SQL Table数据类型修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用sql脚本修改表中特定列的数据类型
How to modify the datatype of a particular column in a table using sql scripts
推荐答案可能使用以下代码段". Probably using Below Snippet. ALTER TABLE table_name MODIFY column_name column_type;
或者您可以参考全文, www.techonthenet/sql/tables/alter_table.ph [ ^ ] 如果有帮助,请 投票 和 接受答案 .
Or you could refer full article, www.techonthenet/sql/tables/alter_table.ph[^] Please vote and Accept Answer if it Helped.
数据将如果某些数据类型的字段类型更改,则将被截断. 也并非所有字段都可以更改 以下是alter column数据类型的示例 Data will be truncated in case field type is changed for some data types. also not all fields can be changed following is the example of alter column datatype Create table testTable (field1 int) --to convert integer field to varchar alter table testTable alter column field1 varchar(20)
我认为Hiren为该问题给出了正确答案. I think Hiren given right answer for the question.
更多推荐
SQL Table数据类型修改
发布评论