Generate semi random id numbers in SQL/Access
Posted on 2011-09-29
We are building a database to track the attendance and survey answers of participants in a program. For the most it is imparitive that the participants of the program remain anonomous and we like to facilitate this by generating id numbers at the time of enrollment/intial data entry into the SQL database. I am supposing that we could just use the incremental primary key number (int) in the main table but I am hoping to make the id number be in a xx-yyy-zzzzz where xx would be a country code, yyy would be a site id and the zzzzz would be for the individual. What would be the best field type and properties in the sql table and what would be the best data entry input mask in a Access 2010 form. Thank you for your suggestions.