Can't really find any details on this, but is the scope of 'SET foreign_key_checks = 0' the current connection, current session or current transaction?
Asked
Active
Viewed 5,377 times
2 Answers
8
It's a session-based statement.
This is to temporarily break the Foreign Key Constraint. It is sometimes necessary to change data in a way that referential integrity needs to be broken during the modification process.

John Woo
- 258,903
- 69
- 498
- 492
7
It is session-based. Full answer and explanation can be found in this other Stack Overflow answer:
“It is session-based. Do a test to be sure, but that's my understanding of it.”

Giacomo1968
- 25,759
- 11
- 71
- 103