Re: Unique consecutive number for id
- From: "John Bell" <jbellnewsposts@xxxxxxxxxxx>
- Date: Sat, 5 Dec 2009 20:46:28 -0000
"Saga" <antiSpam@xxxxxxxxxxx> wrote in message news:%23vGpOhTdKHA.6096@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for your input. I had a look at GUIs, but their huge char size makes themThe article you pointed to also asks the same questions I asked! The main criteria that is required that it is unique within a given time-frame, but that may be per customer or period and the full key may include other columns or prefixes.
unusable, at least for the scenario here. I found this article:
http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-server
I am reading it now. It looks promising, but I need to do more research.
I am not really sure why the numbers have to be consecutive. This is the way
it has worked in the past, hence the reason for getting others' input so that I
can determine if something needs to be changed. Frankly, I am not even sure
if the current process being used now is the cause of the server timing out.
Again, thanks for your time and input. Regards, Saga
"John Bell" <jbellnewspostsNON@xxxxxxxxxxxxxxxxx> wrote in message news:ODglmXTdKHA.1156@xxxxxxxxxxxxxxxxxxxxxxx
"Saga" <antiSpam@xxxxxxxxxxx> wrote in message news:e7kMcyRdKHA.1652@xxxxxxxxxxxxxxxxxxxxxxxHello all, I would like your input on the following matter:
Application in VB6, using ADO 2.7, SQL Server 2000.
An application controls basic operation of a company, including the
assignment of a unique number to each of the shipments that it sends
out. The app, up to now, has been working fine; however, the company
has grown and will continue to grow. I would not be surprised if within
a year there would be 2,000 - 5,000 clients.
In some cases, the server times out and I have been tasked with the
project to overhaul, if necessary, the process that manages the unique
sequential shipping number. The requirements are:
a. Be a consecutive unique number
b. The number must increment by 1 every time that the current one is used.
c. Allow the administrator to define any seed (that is, the numbering
sequence can start at 1 or 4500 or whatever)
d. Be scalable to concurrent use by many users (as mentioned above)
What is the best way to do this? Any general ideas are welcomed, I will
do further research and testing. I am only looking to be pointed in the
best direction to fulfill the above objectives. Thank you for you time and
assistance. Saga
Hi
Why does the number have to be sequential and incrementing by 1? These two requirements make it difficult to implement an efficient scalable solution and are probably not absolutely necessary.
If you generate the numbers on a client or application server then you will have difficulty enforcing uniqueness and continuity e.g. what if one transaction rolls back after a different one has committed? Ignoring numerics and using GUIDs has it own problems, including the fact that random guids make a bad choice for indexes especially clustered ones. Using an Identity column requires that it is returned to the client and doesn't guarantee consecutive numbers.
John
John
.
- References:
- Unique consecutive number for id
- From: Saga
- Re: Unique consecutive number for id
- From: John Bell
- Re: Unique consecutive number for id
- From: Saga
- Unique consecutive number for id
- Prev by Date: Re: help with correlated query and TOP
- Next by Date: Re: Question about index usage in a query
- Previous by thread: Re: Unique consecutive number for id
- Next by thread: Re: Unique consecutive number for id
- Index(es):
Relevant Pages
|