title: SQL Server: Hierarchy recursive CTE with no anchor
body: <p>I'm able to generate a hierarchy with a recursive CTE but I have always made use of an anchor... a top level record with some top level indicator (parentID IS NULL).  I would like to build a hierarchy that doesn't necessarily have a defined anchor.  I have a many to many reference table with a parentID and a childID.  Any parent can be a child and vice versa (avoiding circular reference of course).  I'm thinking this would be more of a bottom-up approach as opposed to top-down.  Thoughts?</p>