title: Removing unconnected nodes from SQL database
body: <p>I'm working on a tree structure with company hierarchy. All the data is stored in a SQL Server database. </p>
  
  <p>The database has two columns with ID and parent node ID (both are <em>varchar(5)</em>).</p>
  
  <p>Now, when i remove a node, all of the node's children (and their children) will be left in the database - unconnected. How am i supposed to remove these?</p>
  
  <p>EDIT: I'm using <a href="https://www.codeproject.com/Articles/18378/Organization-Chart-Generator" rel="nofollow noreferrer">https://www.codeproject.com/Articles/18378/Organization-Chart-Generator</a> to generate the chart.</p>