List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:January 19 2006 7:56am
Subject:Re: Altering column syntax help/and repare
View as plain text  


> I think I really misunderstood the directions for alter table, an I'm
> not sure how to fix this.  I was trying to allow certain columns to be
> null in an existing table.
> I used the following syntax:
>   ALTER TABLE users ALTER COLUMN title SET DEFAULT NULL;
> Now 'describe users;' shows extra columns with no titles.

Extra columns with no titles, what does that mean?

> A.  What did that syntax do?
> B.  How do I undo it?
> C.  What is the proper syntax?

SET DEFAULT NULL has nothing to do with the null-ability of a column,
it has to do with the DEFAULT of a column.

Proper syntax:
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

Check out:
MODIFY [COLUMN] column_definitionMartijn ToniesDatabase Workbench - tool for
InterBase, Firebird, MySQL, Oracle & MS SQL ServerUpscene
Productionshttp://www.upscene.comDatabase development questions? Check the
forum!http://www.databasedevelopmentforum.com

Thread
Altering column syntax help/and repareJohn Stile19 Jan
  • Re: Altering column syntax help/and repareMartijn Tonies19 Jan