Foreign key value in destination table is nullified when origin feature is deleted from relationship - workaround?

02-13-2019 12:26 PM
Occasional Contributor

I have an SDE geodatabase in which I have an origin feature class with relationship classes to several destination feature classes and tables. When a feature is deleted from the origin table, the foreign keys in the all of the destination feature classes and tables are nullified. This has been annoying for the destination feature classes because the foreign keys have to be reestablished, however, it has resulted in lost data for the destination tables because we have no way to figure out which feature they originally belonged to (because there are no spatial data attached) and this has created serious issues.

Is there a workaround for this or a different setting that I need to consider when setting up my relationship classes?

1 Reply
MVP Regular Contributor

I was encountering this issue yesterday too. I have polygons related to a table. I ended up making a copy of the table and using that after I made my polygon edits. I truncated the original table and then append the copy to the original table. This kept all the foreign keys for me. This might not be as straightforward for you since you have multiple relationships going on among multiple feature classes, but if if you have the time and knowledge, scripting it in Python would be really helpful.

0 Kudos