Autonumber Fields???

  • Thread starter Thread starter Bill
  • Start date Start date
No, but then there's no need to.

Autonumbers exist for one purpose only: to provide a (practically
guaranteed) unique value that can be used as a primary key. The value of the
autonumber field shouldn't matter to you: if you're trying to assign meaning
to it, you probably shouldn't be using an autonumber.
 
Bill

No. But you can insert the records into a new table without including the
autonumber field and new ones will be created.

Or if yo ujsut want to clear out test data, empty the table and compact.
That will reset the auto number to start at 1 again.
 
you can if you use Access Data Projects.. can't you?

and you can specify what seed and increment to use

-Aaron
 
First of all, Bill, ask yourself why you want to do that? An Autonumber
field is not guaranteed to be sequential and is generally meaningless to the
end user, so there isn't much reason for it. It's sole purpose should be to
provide a unique identifier for a record and, if that's what you use it for,
then it doesn't matter where it starts. Second, if you are intent on
renumbering it, you can delete all the records from the table and compact
the database. That SHOULD reset it the counter to 1, but there isn't even a
guarantee that that will work in all cases.
 
I disagree.

just because you CANT do this with a MDB it doesn't mean that we
shouldnt be able to do it.

Stop preaching theory


-Aaron
 
To change an IDENTITY field you have to first switch on the ability to
change it using:
SET IDENTITY_INSERT ON

To completely reset autonumbers you have to empty the table using TRUNCATE.
 

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

Back
Top