>What happens if your lookup table gets corrupted by a disk crash and you have to restore from a backup? How do you know what the "Next" number should be? I am a beliver in the KISS principle. Why go thru the bother of setting up a counter and all the error and duplicate checking and record locking if you have a function that can be implemented with essentially one line of code?
On one somewhat unstable network I've added code that checks for duplicates in the IDs because we DID have a problem with a SysAdmin restoring an old ID file after a crash. However I've never had a problem otherwise, and that one wouldn't have been a problem if the SysAdmin had restored everything from the same tape!