This is probably a pretty basic question, but I figure I am making it more difficult than it needs to be by overthinking it.
I have an equipment database. I have a table that lists all equipment manufacturers. What I am trying to figure out is how to assign a MFR ID which is sequential to the first letter of the MFR Name.
Example:
Acme Corporation = "A001"
Ajax Incorporated = "A002"
Arrow Corporation = "A003"
Borax Company = "B001"
Etc.
I have no problem counting the # of A's and assigning the next sequential number. Where my concern lies is if/when a MFR may get deleted from the system, my numbering schema will be off. Ex.... If Ajax gets deleted, my count then becomes 2 and the next sequential ID will be "3" causing a duplicate.
I know the simple solution is not to allow deletions, but face it, s#!t happens.
What I am wondering is how are others handling this type of thing? Am I over thinking this? Another way to do it?
Thanks,
Craig
I have an equipment database. I have a table that lists all equipment manufacturers. What I am trying to figure out is how to assign a MFR ID which is sequential to the first letter of the MFR Name.
Example:
Acme Corporation = "A001"
Ajax Incorporated = "A002"
Arrow Corporation = "A003"
Borax Company = "B001"
Etc.
I have no problem counting the # of A's and assigning the next sequential number. Where my concern lies is if/when a MFR may get deleted from the system, my numbering schema will be off. Ex.... If Ajax gets deleted, my count then becomes 2 and the next sequential ID will be "3" causing a duplicate.
I know the simple solution is not to allow deletions, but face it, s#!t happens.
What I am wondering is how are others handling this type of thing? Am I over thinking this? Another way to do it?
Thanks,
Craig