im trying to do this :

alter table project_info change column number proj_id int not null auto_increment,
add primary key (proj_id);

but mysql tells iv got an error. any help with whats wrong here ? i followed this from head first sql book (page 210 if anyone's interested ) .

Recommended Answers

All 2 Replies

Use MODIFY instead of CHANGE

modify is for changing the type only right ? im trying to change the name and the type together...

this place shows that the keyword column is not needed as iv done above , but that also is giving errors.

edit:

alter table project_info change number proj_id int not null auto_increment,
add primary key (proj_id);

this seems to get the job done .
thanks for helping :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.