>I am trying to decide whether to use sys(2015) to generate a unique primary key value for a table in one of my applications. In this particular case there would be less overhead, and it would be quicker and more simple than getting a 'next number' from a table that stores the next key value.
I didn't have problems with speed, getting a "next number" from a table. However, I didn't do exhaustive speed tests.
If you need it, I can post a copy of my SerialNumber() function.
For disconnected machines or networks, you could combine this with a MachineId or BranchId, which you assign.
An advantage of this method is the size of the keys. The serial number by itself uses 4 bytes. If you combine it with a BranchId, you would probably need 6 bytes, with an expression similar to
bintoc(BranchId,2) + bintoc(SerialNumber()).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)