Expand this to multiple concurrent hierarchies and effective date sensitive?

  • How can I apply this model with a couple of extended properties.

    Using an employee/manager model, I have added a 'hierarchy code' to both entities and an effective date. How could I incorporate these two additional properties to the process in this discussion?

  • Turn the adjacency hierarchy into a standard many-to-many (joining the primary table back to itself), with a date-effective range in the join table.

    When you build the CTE, you just have to include both tables, and then it works just like any other adjacency hierarchy.

    The biggest issue with this is that it becomes possible to have the same node at multiple levels of the hierarchy, which isn't possible in a single-table version. You thus have to use moderately complex code to make sure that inserts and updates don't allow that, or you end up with infinite recursion problems.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply