spikepl
Eledittingent Beliped
- Local time
- Today, 18:04
- Joined
- Nov 3, 2010
- Messages
- 6,142
I have inherited a DB, where the following immutable requirement exists:
A unique "Key" (text) needs to be created for a record, not at the time of creation of the record itself but later. All this in a multiuser environment, so until such time that the key is created for the given record, mutiple records may exist without anything in that field. (This I gather prevents my using Unique Index on the field.)
The Key itself consist of NameOfPeriod & CountOfRecordsInPeriodSoFar + 1, i.e. CountOfRecordsInPeriodSoFar starts with 0 for each new period, and is incremented by 1, each time a new key is created
The records do have an autonumber. The sequence in which the Key is assigned, is not related to the sequence in which the records are created.
Any advice on how to create and store the key, ensuring that it is unique and sequential in a multiuser environment?
A unique "Key" (text) needs to be created for a record, not at the time of creation of the record itself but later. All this in a multiuser environment, so until such time that the key is created for the given record, mutiple records may exist without anything in that field. (This I gather prevents my using Unique Index on the field.)
The Key itself consist of NameOfPeriod & CountOfRecordsInPeriodSoFar + 1, i.e. CountOfRecordsInPeriodSoFar starts with 0 for each new period, and is incremented by 1, each time a new key is created
The records do have an autonumber. The sequence in which the Key is assigned, is not related to the sequence in which the records are created.
Any advice on how to create and store the key, ensuring that it is unique and sequential in a multiuser environment?