Branch Versioning Related Data SQL Views

03-10-2022 12:38 PM
Occasional Contributor

I have an enterprise database with a large point feature class of locations. I have a related table (one location can have many related rows here) and I use attributes in this table to make database views for my locations. This way, users can add only locations relevant to their project to their map (using Arc Pro) without having to use definition queries (which don't work well for this use-case because of performance issues across large tables and usability/shareability limitations).

I just started testing a branch versioning workflow and the archiving columns seem to have broken these views--since now each view is pulling in the whole archive of edited rows instead of the last edited row.

I have reviewed this thread that poses the same question: and had difficulty implementing a REST query. I can't find a way to query my feature service based on its related table (ie: return rows in my point feature class that have related column=X) and add both the locations, relationship and related data to the map.

I was also having trouble wrapping my head around the suggested query. It seems like to get what I want, in the related table, I'd need to do a max(last_edited_date) for each distinct foreign key from my location table. But I'm not sure how to write a query like that (or if it's even possible)

Anyone have any ideas on how to get different subsets of branch versioned data from two related tables into Arc Pro as layers?

0 Kudos
0 Replies