How change start autonumber ???

R

Ryan

How do I set the starting autonumber to other than 1 ???

Does it matter if the table has already had records added so long as they have been deleted?
i.e. if the table is empty is it possible even though it had had records added then deleted?

I looked in Help but its very vague.
 
T

Tim Ferguson

How do I set the starting autonumber to other than 1 ??

append a record with the AN field set to one less than the one you want:

INSERT INTO MyTable (MyAutonumber)
VALUES (99);

you can then delete it again

DELETE FROM MyTable WHERE MyAutonumber = 99;
Does it matter if the table has already had records added so long as
they have been deleted?

If the AN counter is higher than where you want to start, you'll have to
compact the database to reset it to zero, then insert the dummy record.

**************** BUT ******************

"If you care what value an autonumber has, then
you probably shouldn't be using an autonumber..."


Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top