PC Review


Reply
Thread Tools Rate Thread

Autonumber deleted IDs resued after Compact?

 
 
Jack Leach
Guest
Posts: n/a
 
      9th Jan 2010
Hi, thanks in advance...

If you were to delete some records from a table with an autonumber PK, will
those ID's that were used for the deleted records be available as new ID's
after a compact and repair?

I'm setting up a notifications system and am worried that with the high
volume on the table I may overflow the Long datatype in a few years. I plan
to have the notifications table purged on a weekly basis, and I have a
scheduled compact/repair on the backend on a monthly basis already... just
curious if I can plan on the PK re-using the purged values or if I should go
some other route for the IDs

Thanks,


--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)

 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      9th Jan 2010
On Fri, 8 Jan 2010 17:41:01 -0800, Jack Leach <dymondjack at hot mail dot com>
wrote:

>Hi, thanks in advance...
>
>If you were to delete some records from a table with an autonumber PK, will
>those ID's that were used for the deleted records be available as new ID's
>after a compact and repair?


Only if they were at the high end of the list (i.e. off the end, not out of
the middle)... and not with all versions of Access, either; some reset the key
only if you completely empty the table.

>
>I'm setting up a notifications system and am worried that with the high
>volume on the table I may overflow the Long datatype in a few years. I plan
>to have the notifications table purged on a weekly basis, and I have a
>scheduled compact/repair on the backend on a monthly basis already... just
>curious if I can plan on the PK re-using the purged values or if I should go
>some other route for the IDs


I was curious enough to do some calculations. If you add records at the rate
of one per second, starting now, not taking any weekends or holidays, you'll
run through the 4 billion odd autonumber values (it picks up at -2147483648
and counts up to 0 after it hits 2147483647) sometime in the afternoon of
2/15/2146. I.e. - NOT TO WORRY!
--

John W. Vinson [MVP]
 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      17th Jan 2010
John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com> wrote:

>>If you were to delete some records from a table with an autonumber PK, will
>>those ID's that were used for the deleted records be available as new ID's
>>after a compact and repair?

>
>Only if they were at the high end of the list (i.e. off the end, not out of
>the middle)... and not with all versions of Access, either; some reset the key
>only if you completely empty the table.


Jet 4.0/Access 2000 and newer only reset the autonumber seed if all
records were deleted. Jet 3.5/A97 and older did reset the seed even
if records were still present in the table.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autonumber restarting after compact and repair Boon Microsoft Access Queries 4 9th Feb 2010 04:28 PM
Restoring deleted autonumber ed finley Microsoft Access Database Table Design 3 26th Aug 2004 04:07 PM
Re: Re-inserting Deleted Autonumber record Lynn Trapp Microsoft Access Getting Started 0 25th May 2004 05:24 PM
Autonumber and Compact helpseeker Microsoft Access VBA Modules 1 14th Aug 2003 07:50 AM
Re: Autonumber Reset & Compact RobFMS Microsoft Access 0 15th Jul 2003 02:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:49 PM.