L
LilMorePlease
I created a database that keeps track of assigned batches for users. My
question pertains to the process of deleting batches. I have a batch table
which is like a master list of all of the batch numbers and an assigned
batches table which obviously keeps track of assigned batch information.
I am working on a delete batch form. It won't delete the actual batch
numbers, just the record in the assigned batches table. I am wondering how I
go about preventing bloat in the employee and manager tables. For example,
if I've just deleted the only assigned batch for Bobby Smith, should I delete
the employee record as well, and then check to see if his manager is tied to
any other assigned batch and if not, delete that record in the manager table?
Or is there a better approach to cleaning up employee and manager records?
I don't believe cascade deletes will work because the employee & manager
tables are primary tables, not the assigned batches.
One problem I see in deleting emloyee records in addition to assigned
batches is that if the user makes a mistake when creating a batch and then
deletes it, they will have to re-create the employee record again. I suppose
I could have a message box in the delete form telling the user that the
employee currently has no assigned batches and asks them if they want to
delete it or not. Would that be the best method?
The other thing I was thinking I could do is just have a cleanup utility
that the user could access through the switchboard. Every so often the user
could go in and clean it up, thereby deleting all managers and employees that
don't have related records in the assigned batches table.
Suggestions and advice are greatly appreciated,
AA
question pertains to the process of deleting batches. I have a batch table
which is like a master list of all of the batch numbers and an assigned
batches table which obviously keeps track of assigned batch information.
I am working on a delete batch form. It won't delete the actual batch
numbers, just the record in the assigned batches table. I am wondering how I
go about preventing bloat in the employee and manager tables. For example,
if I've just deleted the only assigned batch for Bobby Smith, should I delete
the employee record as well, and then check to see if his manager is tied to
any other assigned batch and if not, delete that record in the manager table?
Or is there a better approach to cleaning up employee and manager records?
I don't believe cascade deletes will work because the employee & manager
tables are primary tables, not the assigned batches.
One problem I see in deleting emloyee records in addition to assigned
batches is that if the user makes a mistake when creating a batch and then
deletes it, they will have to re-create the employee record again. I suppose
I could have a message box in the delete form telling the user that the
employee currently has no assigned batches and asks them if they want to
delete it or not. Would that be the best method?
The other thing I was thinking I could do is just have a cleanup utility
that the user could access through the switchboard. Every so often the user
could go in and clean it up, thereby deleting all managers and employees that
don't have related records in the assigned batches table.
Suggestions and advice are greatly appreciated,
AA