atticus1802
Registered User.
- Local time
- Today, 12:26
- Joined
- May 5, 2010
- Messages
- 43
I have created a large databse for my company detailing employees information as well as desk information. At the moment I have two tables one detailing the employee information, name, address etc, the second detailing desk information, desk number, laptop lock code etc.
These are linked together via a relationship, the employee number is unique and has been tied to both the desk and the employee. The trouble Im having is that not every employee has a desk as they work out the office and not every desk has a user. I cannot enforce referential integrity as the employee number is not valid for every desk as some are kept empty for when employees visit.
This is currently working ok except when employees leave their information is deleted but as referential integrity is not enforced the employee number will still be linked to the desk. If it is enforced the employees information and the desk information are both deleted. What I would like to achieve is that if an employee leaves and their information deleted in the form that the empoyees number will be automatically removed from the desk number without deleting the desk information.
Hope this explains my situation clearly.
These are linked together via a relationship, the employee number is unique and has been tied to both the desk and the employee. The trouble Im having is that not every employee has a desk as they work out the office and not every desk has a user. I cannot enforce referential integrity as the employee number is not valid for every desk as some are kept empty for when employees visit.
This is currently working ok except when employees leave their information is deleted but as referential integrity is not enforced the employee number will still be linked to the desk. If it is enforced the employees information and the desk information are both deleted. What I would like to achieve is that if an employee leaves and their information deleted in the form that the empoyees number will be automatically removed from the desk number without deleting the desk information.
Hope this explains my situation clearly.