>I just tested it with a program that uses a FOR NEXT loop to insert 20,000 records into a small table using SYS(2015) to generate a key. Two concurrent FoxPro sessions running this program simultaneously on a 866 Mhz PIII machine generated 33 duplicates. So I would say that this method is not good in a multiuser environment where keys are being generated very rapidly (Hundreds or more per second).
>
>Or trap the duplicate key error and try it again. That may be the best solution. I little slower, but more reliable.
I've used it for generating unique IDs for remote machines, i.e. for the synchronization and replication purposes, but only when accompanied with an user ID - I've used a two character prefix, plus the nine characters from sys(2015). Works like a charm, as long as no user runs it in parallel like you described.