Hello all, I am trying to create a column using the following…
ALTER TABLE states ADD COLUMN IN CHAR(1);
I get an error message because I am trying to use “IN” as my column heading, is there a way around this? I really would like to use “IN” as my column name.
Thank you again for veiwing my post.
you should use
ALTER TABLE states ADD [IN] CHAR(1);
No you really REALLY wouldnt!
IN is a reserved word for MySQL and you are setting yourself up for some mammoth headaches if you do it.
See http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html for a full list of reserved words.
Either rethink your table plan or come up with a different naming convention.
how do you know it’s mysql?
how do you know [IN] will work?
the original poster neglected to identify his database system
in any case, as spike said, it’s far better to use a non-problematic name
Stab in the dark with a rusty carrot…!