Turning off referential integrity

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

Guest

Is there a way to turn off referential integrety for all tables in a database
at one shot, and then turn it back on again? I need to clear out a bunch of
test data and was hoping to not have to go into the relationship window and
manually turn off and then on again referential integrety?

Thanks, Rob
 
RobUCSD said:
Is there a way to turn off referential integrety for all tables in a database
at one shot, and then turn it back on again? I need to clear out a bunch of
test data and was hoping to not have to go into the relationship window and
manually turn off and then on again referential integrety?


If you delete the child records before the parent records,
you will not create a referential integrity violation. If
you have a lot of tables and you will be doing this
frequently, try creating a VBA procedure to do the DELETE
queries.
 
If you delete the child records before the parent records,
you will not create a referential integrity violation. If
you have a lot of tables and you will be doing this
frequently, try creating a VBA procedure to do the DELETE
queries.

Likely best done inside a transaction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top