title: Flatten the tree path in SQL server Hierarchy ID
body: <p>I am using SQL Hierarchy data type to model a taxonomy structure in my application.
  The taxonomy can have the same name in different levels</p>
  
  <p><img src="https://i.stack.imgur.com/o8lW0.png" alt="enter image description here"></p>
  
  <p>During the setup this data needs to be uploaded via an excel sheet.</p>
  
  <p>Before inserting any node I would like to check if the node at a particular path already exists so that I don't duplicate the entries.
  What is the easiest way to check if the node @ particular absolute path already exists or not? </p>
  
  <p>for e.g Before inserting say "Retail" under "Bank 2" I should be able to check "/Bank 2/Retail" is not existing</p>
  
  <p>Is there any way to provide a flattened representation of the entire tree structure so that I can check for the absolute path and then proceed?</p>
  
  <p><img src="https://i.stack.imgur.com/ZQGJ6.png" alt="enter image description here"></p>