mSQL version 1.x does not have an automatic key assignment functionality. A number of solutions to this problem are available. • Use Pascal Forget’s unique sequence number generator. • Build the unique key assignment and management into your application. One suggestion on how to implement this comes from Vivek Khera . Vivek writes: What I do is take some of the fields in the record, tack on a salt like the current time and generate a hash (either SHA or MD5) of it. I use part of the the hash string value as the key. Another solution is provided by Rasmus Lerdorf . Rasmus writes: The issue here is not so much how to generate a key, but how to ensure it is unique. The way I have done it in the past is to associate a lock file with each table. Each table has a counter record. With the table locked, I pull out the current counter value, increment it, and put it back. Then I unlock the table. This is not the most efficient way to do it, but it does wor