Must I include all column attributes in an SQL statement when I want to alter only one?

流过昼夜 提交于 2019-12-06 07:13:51

The documentation is pretty clear that CHANGE COLUMN requires the full column definition:

CHANGE [COLUMN] old_col_name new_col_name column_definition

Anything optional would be in brackets.

Your best bet is probably to write a little one-off script to produce your ALTER TABLE commands based on the table's current schema. You should be able to extract the column definitions from whatever data access layer you're using.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!