title: Sql HierarchyId How do I get the 2 level ancestors
body: <p>Using sql hierarchy Id how do I get all of the rows that have no children (that is the last decendants)?</p>
  
  <p>Say my table is structured like this:</p>
  
  <pre><code> Id, 
   Name,
   HierarchyId
  </code></pre>
  
  <p>And has these rows:</p>
  
  <pre><code>1, Craig, /
  2, Steve, /1/
  3, John, /1/1/
  4, Collin /1/1/1
  5, Sam, /2/
  6, Matt, /2/1/
  7, Chris, /2/1/1/
  8, Molly, /2/1/1/1
  </code></pre>
  
  <p>Now when I pass the Id = 8, i.e. for molly i want ancestors 2 levels up that means Matt and chris</p>
  
  <p>similarly for others also.</p>
  
  <p>How can i achieve this?</p>
  
  <p>Thanks</p>