问题
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