Hi - I have a question very similar to this one:
thread183-1373478
I have a field called "creatorID" and a field called "editorID" in tblPlacement each of which contain numeric values corresponding to "employeeID" in tblEmployee.
The problem is that currently there is no integrity enforced between the two tblEmployee and tblPlacement.
This means if someone deletes an employee leaving "creatorID" in tblPlacement an orphan, my application bombs out, and I have to manually go into update the offending record to a valid employeeID before it works again.
Creating a relationship from tblEmployee.employeeID > tblPlacement.creatorID and THEN AGAIN from tblEmployee.employeeID to tblPlacement.editorID seems not to be a good idea - or is it? - Or could this be accomplished by writing validation code or a trigger of some sort? It seems that with proper DB design, I shouldn't have to write validation code, should I?
What is the proper design to enforce integrity here?
thread183-1373478
I have a field called "creatorID" and a field called "editorID" in tblPlacement each of which contain numeric values corresponding to "employeeID" in tblEmployee.
The problem is that currently there is no integrity enforced between the two tblEmployee and tblPlacement.
This means if someone deletes an employee leaving "creatorID" in tblPlacement an orphan, my application bombs out, and I have to manually go into update the offending record to a valid employeeID before it works again.
Creating a relationship from tblEmployee.employeeID > tblPlacement.creatorID and THEN AGAIN from tblEmployee.employeeID to tblPlacement.editorID seems not to be a good idea - or is it? - Or could this be accomplished by writing validation code or a trigger of some sort? It seems that with proper DB design, I shouldn't have to write validation code, should I?
What is the proper design to enforce integrity here?