473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Autonumber Data type

37
What is the max number autonumber will count to? Can it automatically re-use previous numbers which have been deleted once it has reached the max number?
Jan 17 '07 #1
10 8210
ADezii
8,834 Expert 8TB
What is the max number autonumber will count to? Can it automatically re-use previous numbers which have been deleted once it has reached the max number?
Since an AutoNumber Field is essentially a Long Integer Data Type, and if the old neurons are still working, I think the maximum value for a Long Integer is 2,147,483,647. To the best of my knowledge, numbers which have been deleted can never be reclaimed.
Jan 18 '07 #2
ozzii
37
Since an AutoNumber Field is essentially a Long Integer Data Type, and if the old neurons are still working, I think the maximum value for a Long Integer is 2,147,483,647. To the best of my knowledge, numbers which have been deleted can never be reclaimed.
I have a database in which I am using autonumber to assign unique identifiers to records. However the database requires the insert and delete of approx 10000 records daily. If i am inserting and deleting this many records daily, one can appreciate I will run out of this autonumber identifier very quickly. Is there a way round this so that I can automatically generate i unique identifier for each record using autonumber without the possibility of running out of autonumbers to use?
Jan 18 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
I have a database in which I am using autonumber to assign unique identifiers to records. However the database requires the insert and delete of approx 10000 records daily. If i am inserting and deleting this many records daily, one can appreciate I will run out of this autonumber identifier very quickly. Is there a way round this so that I can automatically generate i unique identifier for each record using autonumber without the possibility of running out of autonumbers to use?
If you compact and repair the database each time after deleting the records the numbers will be reset. However, this operation will close and then reopen the database.
Jan 18 '07 #4
NeoPa
32,556 Expert Mod 16PB
I have a database in which I am using autonumber to assign unique identifiers to records. However the database requires the insert and delete of approx 10000 records daily. If i am inserting and deleting this many records daily, one can appreciate I will run out of this autonumber identifier very quickly. Is there a way round this so that I can automatically generate i unique identifier for each record using autonumber without the possibility of running out of autonumbers to use?
At that rate, just using very rough arithmetic, you have over 200,000 days or nearly 600 years. You could try resetting it every 500 years for safety ;)
Jan 18 '07 #5
cyberdwarf
218 Expert 100+
ozzii

Alternatively, you could use a UniqueIdentifier data type...

HTH

Steve
Jan 18 '07 #6
ozzii
37
If you compact and repair the database each time after deleting the records the numbers will be reset. However, this operation will close and then reopen the database.
Is there a way to compact and repair the database using asp code? Sample code would be appreciated.
Jan 18 '07 #7
MMcCarthy
14,534 Expert Mod 8TB
Is there a way to compact and repair the database using asp code? Sample code would be appreciated.
I'm afraid you'll probably have to check in with the ASP forum on that one ozzii.
Jan 18 '07 #8
Killer42
8,435 Expert 8TB
At that rate, just using very rough arithmetic, you have over 200,000 days or nearly 600 years. You could try resetting it every 500 years for safety ;)
Personally, I would consider such a limit much too restrictive. Not because of the 600 years, but because it doesn't allow enough slack for increases in the rate of allocation.

If some business change meant that you now have to load a thousand times as many records per day, suddenly you've only got enough unique numbers for 7 months. What if the increase was ten thousand times? Then you've only got 20 days or so to solve the problem.

Now, I realise this scenario may be unlikely, and would certainly involve other considerations (storage space, processing time, etc) but I always recommend leaving lots of room for expansion, so that at least it's one less thing to worry about. (Or to put it another way, "no more Y2Ks please":))

If we are talking about Access, then perhaps one could use a "Replication ID" Autonumber rather than the usual Long Integer type. I don't know much about it, but it is 16 bytes long, so may be worth investigating.
Jan 19 '07 #9
NeoPa
32,556 Expert Mod 16PB
As someone who never contributed to the Y2K problem (and I was writing code before the Eighties started and was instructed to ignore the problem on numerous occasions), I can happily disagree with you on at least the emphasis of your point. If the project changes that drastically then whoever implements the change is in a position to redesign the solution where necessary. I agree that too precise planning without allowance for any naturally occurring changes to the parameters is not good design, but I think in this case that this is OTT. I can happily accept that there may be instances where the size of the Long Integer AutoNumber field is too restricting, but not that this is one of those instances.
Jan 19 '07 #10
Killer42
8,435 Expert 8TB
As someone who never contributed to the Y2K problem (and I was writing code before the Eighties started and was instructed to ignore the problem on numerous occasions), I can happily disagree with you on at least the emphasis of your point. If the project changes that drastically then whoever implements the change is in a position to redesign the solution where necessary. I agree that too precise planning without allowance for any naturally occurring changes to the parameters is not good design, but I think in this case that this is OTT. I can happily accept that there may be instances where the size of the Long Integer AutoNumber field is too restricting, but not that this is one of those instances.
Well, I suppose everyone's entitled to their opinion... ;)

At work a while back, I deliberately set up a file with an "autonumber equivalent" field that allowed us something like 150,000 years worth of allocations. :) (However, that's because we knew that the rate of record creation was going to accelerate rapidly.)
Jan 19 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
13
by: Peter | last post by:
Can anyone tell me how to change the data type of a field in a table created with a make table query? The field is a binary and must be changed to text. alternately does anyone know how to specify...
4
by: Blake D. | last post by:
I have two tables (tblClients and tblEmployees). Field in tblClient uses the PK of tblEmployee as a lookup. Currently, the PK is a text field containing the person's name. I want to add a...
13
by: Fei Liu | last post by:
Hi Group, I've got a problem I couldn't find a good solution. I am working with scientific data files in netCDF format. One of the properties of netCDF data is that the actual type of data is only...
3
by: hpaisawala | last post by:
Hiya, Is it possible to create a command button on a form and code it such that it goes to a particular field and changes the data type property of that filed from Auto Number to Number. Many...
2
by: BigGuy316 | last post by:
I am receiving this following error message for this particular section of code. I am working on some ASP pages for an Access database. The only problem I can see is possibly that the FormID is...
1
by: DC | last post by:
Any idea why this code would cause a error? The SQL that gets executed seems to be (using record 1132 as an example) DELETE FROM user_table WHERE ID = '1132'; And the value of...
2
by: Kissi | last post by:
I would like the Auto Number field to have 7 digits and the first character "E" eg ; E0000001, E0000002...,E00000120. Can someone help please?
14
by: ezechiel | last post by:
Hello, I know others have the same problem here, I tried (a lot! ) different solutions but still can't get around the problem.. :s Here's the code: Private Sub cb_swedit_sopi_AfterUpdate()...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.