views:

210

answers:

3
create table test(
    locationExpect varchar(120) NOT NULL;
);

I want to change it to :

create table test(
    locationExpect varchar(120);
);
A: 

This should do it:

ALTER TABLE test MODIFY locationExpert VARCHAR(120)
DR
+3  A: 

Do you mean altering the table after it has been created? If so you need to use alter table, in particular:

ALTER TABLE tablename MODIFY COLUMN new-column-definition

e.g.

alter table test modify column locationExpect varchar(120);
mikej
A: 

This should do it

ALTER TABLE TEST

ALTER COLUMN [locationExpect] varchar(120) NULL

GO

edit: Ah my solution is for SQL Server, didn't see MySQL

ajdams
Probably best to edit or delete your answer then in order to avoid confusion.
mikej
Did just that, thanks!
ajdams