Changing the Datatype of table column

本秂侑毒 提交于 2019-12-24 21:07:18

问题


A very simple MSSQL command is giving error.

create table emp (empid char(6));

insert into emp values(3);

ALTER TABLE emp MODIFY empid char(10); //The error line :@

Error >Line 1: Incorrect syntax near 'empid'.

It's mindboggling, either the day is not mine or All Hail MS :P

Any resolutions?


回答1:


Change it to

ALTER TABLE emp ALTER COLUMN empid char(10)

Have a look at

ALTER TABLE (Transact-SQL)

and search for ALTER COLUMN examples



来源:https://stackoverflow.com/questions/1979883/changing-the-datatype-of-table-column

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