So I am running into a problem trying to create a delete script. The below error is what I am receiving:
DELETE statement conflicted with COLUMN SAME TABLE REFERENCE constraint
What I have noticed is that two fields within this TableA, one being the Primary Key, are set up to be constraints to one another. In case that didn't make sense.
(PK)TableA.Key_ID <--> (FK) TableA.Second_Key_ID.
I am trying to remove the record but receiving the above error. I have tried to update TableA.Second_Key_ID to null but I still receive the same error. Does anyone know a good way, within a script, to accomplish the delete on a row that has a constraint to itself.
A little additional information this table is a vendor created table so modifying the constraint at a table level is not possible solution.
Thanks for the help and if any additional information is needed let me know.
Yeagly
DELETE statement conflicted with COLUMN SAME TABLE REFERENCE constraint
What I have noticed is that two fields within this TableA, one being the Primary Key, are set up to be constraints to one another. In case that didn't make sense.
(PK)TableA.Key_ID <--> (FK) TableA.Second_Key_ID.
I am trying to remove the record but receiving the above error. I have tried to update TableA.Second_Key_ID to null but I still receive the same error. Does anyone know a good way, within a script, to accomplish the delete on a row that has a constraint to itself.
A little additional information this table is a vendor created table so modifying the constraint at a table level is not possible solution.
Thanks for the help and if any additional information is needed let me know.
Yeagly