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.
gk53
October 4, 2011, 1:56pm
2
storm925:
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);
SpikeZ
October 4, 2011, 2:01pm
3
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.
r937
October 4, 2011, 2:12pm
4
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
SpikeZ
October 4, 2011, 2:13pm
5
Stab in the dark with a rusty carrot…!