10-08-2012, 06:51 PM
|
PM User |
#3
|
|
Regular Coder
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
|
Quote:
Originally Posted by Fou-Lu
You can't, auto increment only works on numbers. They are literally surrogate keys.
Perhaps a better approach would be to use a char(36) and run against a UUID(). UUID will generate a 128bit hex encoded string. The documentation suggests is uses a UUID version 2, but it also specifies it uses random numbers on any OS that isn't freebsd based. Otherwise it is random replaced which is more appropriate of a version 4, even though it doesn't resign it as a version 4 UUID.
UUID is supposed to give you global unique numbers, but with the above mention that doesn't actually guarantee it now. Since its the key, it will inform you if it fails and you can try again.
|
Fou-Lu,
Also suggest on the below thread.
http://www.codingforums.com/showthread.php?t=275489
Regards,
Nani
|
|
|