AutoNumber Sequence

Bilbo_Baggins_Esq

Registered User.
Local time
Today, 08:30
Joined
Jul 5, 2007
Messages
586
Lets say you have a table with an AutoNumber field
You populate it with 100 records
You delete the last 10 records (91-100)

Now, I certainly know you can refresh the AutoNumber sequencing by compacting the database so the next record entered is 91.

HOWEVER, THAT IS NOT MY QUESTION

My question is about NOT refreshing the AutoNumber sequencing.

Lets say you DO NOT COMPACT and DO NOT refresh the AutoNumber Sequence.
So, in that scenario, after deleting records 91-100 from the table, is there any programmatic way to determine that the next actual AutoNumber for that table will be 101?
 
is there any programmatic way to determine that the next actual AutoNumber for that table will be 101?
NO !

To be honest, even if you delete and "refresh" the autonumber sequence it is not 100% that the next number will be continuing from where it left off. The concept of continuous numbers for an autonumber field is a myth. It guarantees unique number not continious, not even positive. They can be negative but will never be duplicate. If you want something like that, you do not depend on Autonumbers. They are not for human consumption.
 
Have a table(with only an id field). Add as many records as your first one, but do not delete any. Only quick fix of a way that I can think of.
 
That or just save the last autonumber generated into a single record's field of a table.
 

Users who are viewing this thread

Back
Top Bottom