Deletion from multiple tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two tables, tblJob and tblJobHistory. tblJob has an indexed field txtJobID. tblJobHistory also has a field txtJobID. Is it possible to delete ALL tblJobHistory records and tblJob records that match a specified criteria using a query.
 
I believe you would need two queries to do that, but if you set up a
relationship as cascade deletes, then when you delete a JobID record, all
the history would also be deleted. Make sure that is what you want in ALL
cases though, before you do it.

I use it in our database to delete classes and misc items when an employee
record is deleted. But I don't delete installation records for software
they have installed for our clients because we need to retain that
information even if an employee leaves.

HTH

Rick


I have two tables, tblJob and tblJobHistory. tblJob has an indexed field
txtJobID. tblJobHistory also has a field txtJobID. Is it possible to delete
ALL tblJobHistory records and tblJob records that match a specified criteria
using a query.
 
I get your drift. Seems to work ok using the cascade deletions. Thanks very much for the advice.
 
Back
Top