Page 1 of 1
multiple auto_incremented field
Posted: Wed Jan 24, 2007 11:46 pm
by neel_basu
I just wanna make it Sure if more than one auto_increment field can be created or not as far I know the Answer Is no . Nut I Wanna make sur about it
Plase Anwer
EDIT : OOPS Sorry Spelling mistake
Posted: Wed Jan 24, 2007 11:50 pm
by feyd
Spell check.
Why not try it and find out?
Posted: Thu Jan 25, 2007 12:12 am
by volka
Posted: Thu Jan 25, 2007 3:47 am
by neel_basu
feyd wrote:Spell check.
Why not try it and find out?
Ya I've Tried It.
It Shows
mysql_error() wrote:Incorrect table definition; there can be only one auto column and it must be defined as a key
Error Number 1075
I've visited there
http://dev.mysql.com/doc/refman/5.1/en/create-table.html wrote:AUTO_INCREMENT
The initial AUTO_INCREMENT value for the table. In MySQL 5.1, this works for MyISAM, MEMORY, and InnoDB tables. To set the first auto-increment value for engines that do not support the AUTO_INCREMENT table option, insert a “dummy” row with a value one less than the desired value after creating the table, and then delete the dummy row.
For engines that support the AUTO_INCREMENT table option in CREATE TABLE statements, you can also use ALTER TABLE tbl_name AUTO_INCREMENT = N to reset the AUTO_INCREMENT value.
------------------------------------------------------------------------------------------------
But Does it mean only one auto_increment is possible ??
Posted: Thu Jan 25, 2007 4:15 am
by volka
not necessarily, but
does

Posted: Thu Jan 25, 2007 4:20 am
by neel_basu
yes
Thanks a lot I got it.
I was Just Trying to Know This answer.
Thank you .