I am exporting data from csv into mysql database, I want the database to generate a unique id for each imported record. I want to use the unique field in generating a receipt number in crystal report.
What would you suggest as the best way of doing this?
If you don't want to auto increment the only other way to virtually guarantee uniqueness is to use a GUID as the id.
I say "virtually" as there is a theoretical possibility that the same GUID could be generated twice, but it's effectively zero for all everyday uses. From the Wikipedia article:
The total number of unique keys (2128 or 3.4×1038) is so large that the probability of the same number being generated twice is extremely small, and certain techniques have been developed to help ensure that numbers are not duplicated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With