views:

20

answers:

1

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  A: 

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

astander