[support] Auto increment fields
Earnie Boyd
earnie at users.sourceforge.net
Tue Apr 19 19:08:42 UTC 2011
Austin Einter wrote:
> Anybody observed, the auto-increment fileds in a table is NOT always
> incremented by 1 with each row insert.
> But as per SQL manual it should be increased by 1.
>
> Is this behavior Ok? Or I am doing something wrong.
>
> Note: I do not write any value to this coulmn in my INSERT statement, this
> coulmn values are set by system automatically.
>
> Values I have seen for auto-incrment field -> 1,2,3,4,8,9,10,18,19,20 etc...
> So in between the values incremented by more than 1.
I'm going to guess that some inserts failed but ended up incrementing
the auto-increment value. This shouldn't be a real problem, just looks
weird to you. The other scenario is that an insert happened followed by
a delete, the delete doesn't reset the auto-increment value since rows
can be deleted in the middle.
--
Earnie
-- http://progw.com
-- http://www.for-my-kids.com
More information about the support
mailing list