<<However, once the new numbers are entered in, the query will just duplicate the new numbers, thus bumping out the SSN. >>
Please give more explanation to the above line.
Main Topics
Browse All TopicsHere is the situation.
My HR database uses SSN as the primary key. However, due to new regulations, SSN cannot be in a database. I have to keep those SSN though because I have other fields that are linked to this field. My HR department created new Employee Numbers, randomly. I need to have these numbers as the new Employee# (primary key), but also keep an archived column in that table with the SSN numbers. I initially set up an update query that automatically ran whenever the database opened, which made the Employee # (primary key) equal to a new field called EmployeeID. However, once the new numbers are entered in, the query will just duplicate the new numbers, thus bumping out the SSN. Is there anyway that a conditional update query can be written? Can you think of anything else that could be done to fix this problem? Am I totally off base?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi christie_holtz,
You're going to need a mapping table with two columns, Employee ID and SSN. The first step will be to fill this table with every SSN in your system and a corresponding employee ID. Once that is done add (if it doesn't exist yet) an employee ID field to all of your tables that need it and use the map table to update them based on the SSN they contain. Then remove the SSN field from all tables and adjust your key to include the EmployeeID field.
And it goes without saying that you'll need a backup or two before you do this.
Kelly
You need a new field on your tables for Employee#
With the mapping table that Kelly suggested you can run a query to update all your tables.
The mapping table should have Employee# and EmployeeID as fields with EmployeeID holding the SSN
UPDATE StaffTest SET StaffTest.Employee# = [MappingTable.Employee#] Where StaffTest.EmployeeID=Mappi
Hopefully when this question is closed the admins can clean all those posts up. The bottom line is that because you have a 'bad' character in your field name (the 3 sign) you need to bracket the table and the field with square braces. You can't do this: [mytable.myfield#] but you can do this: [mytable].[myfield#]
Ok...Here is what I am doing. I am going to the Query section and writing a new query. In design view, I add the two tables to the query....I then go into SQL view and copy the statement, however when I go back to design view....the mappingtable is missing...so then when I try to run the query I get prompts to enter in MappingTable.Employee# and MappingTable.EmployeeID...
Hi christie and capricorn1
my opinion on this matter: if it is illegal to kepp SSN, you should not keep it in the database
if you need it, because you used it as key to bind otehr records, you should try the following:
based on the saved("old") version:
1. set up links for the SSN to the other tables with referential integrity set to yes for updates
2. overwrite the SSN with newly assigned random number
so all links will be automatically updated.
3. keep a manual list for new number mapped to SSN in a safe place, so you can interpret old printouts if necessary
Regards, Franz
Hey Franz that's what I had in mind also per my post way up there, but I think she wants to permanently keep the ssn field in the database and hide it somehow even after the links are updated. I have to admit I'm still not clear on exactly why she wants to keep the ssn field after the links have been updated.
Hi Rey,
Lets see, what Christie makes of it. If there is no technical necessety, she should not keep it. Keeping the mapping of new nuber to ssn as extra-file should be sufficent. You can import it as table with a click, if you need it for some reason in the future.
if for organisational reasons, she will need it in the application, she wiill need to personalize and secure the usage of the mdb, so only specaily privileged users will be able to see this form. of corse in this case the mapping will have to be held in an extra table, so you can secure this table also.
Regards, Franz
With all of your help, I have actually come up with something. I created an AutoExec marco which ran a SQL statement which updated only specific employee numbers...after adding an autonumber as a counting device. The SQl statement updates Employee#=EmployeeID only if the Employee# is >356 (the current number of employees)....otherwise Employee# is a newly assigned random number and EmployeeID is SSN.....
I understand this was logically a tough request...and I agree...I don't understand HR insists on keeping SSN....
Thanks
Business Accounts
Answer for Membership
by: capricorn1Posted on 2004-02-10 at 10:24:22ID: 10324587
did you set the employee# to no duplicates?