Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi I want to generate a unique string consists of 8 char and number which i can insert
this string as a primary key not repeated
thanks
Posted

1 solution

Primary Keys should always be a numeric type (and make it auto-increment) if you have a choice. If you can still fix this, do it.
Some methods for creating unique strings can be found here (probably best)[^], here[^], here[^], and possibly some more here[^] ;)
The last method of the third one actually kind of way off creates strings of exactly length 8.
Hope it helps!
 
Share this answer
 
v4
Comments
RaviRanjanKr 5-Nov-11 10:58am    
My 5+
Sander Rossel 5-Nov-11 11:04am    
Thanks Ravi :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900