An SQL Server 2000 Foreign Key Constraint Anomaly is occuring.
The following tables exist in my database:
Person Table
Orders Table
Pers_id on Orders is a Foreign Key referencing Pers_id on Person Table
The following statements are executed in the following order:
Delete from Orders where Pers_id = 100
Delete from Person where Pers_id = 100
The SECOND statement produces a Foreign Key Constraint Violation
This should NOT occur since the Referencing record is deleted first........
This only happens on a few fluke records...
Clearly this SHOULD happen if an attempt was made to delete Person record first.
In order to workaround this problem I had to disable this Foreign Key Constraint. (which I don't want to do)
Very puzzling....... Any ideas ?
Thanks
John
The following tables exist in my database:
Person Table
Orders Table
Pers_id on Orders is a Foreign Key referencing Pers_id on Person Table
The following statements are executed in the following order:
Delete from Orders where Pers_id = 100
Delete from Person where Pers_id = 100
The SECOND statement produces a Foreign Key Constraint Violation
This should NOT occur since the Referencing record is deleted first........
This only happens on a few fluke records...
Clearly this SHOULD happen if an attempt was made to delete Person record first.
In order to workaround this problem I had to disable this Foreign Key Constraint. (which I don't want to do)
Very puzzling....... Any ideas ?
Thanks
John