title: TSQL Inserting records and track ID
body: <p>I would like to insert records in a table below (structure of table with example data). I have to use TSQL to achieve this:</p>
  
  <pre><code>MasterCategoryID    MasterCategoryDesc  SubCategoryDesc     SubCategoryID
  1                   Housing             Elderly              4 
  1                   Housing             Adult                5  
  1                   Housing             Child                6
  2                   Car                 Engine               7
  2                   Car                 Engine               7
  2                   Car                 Window               8
  3                   Shop                owner                9   
  </code></pre>
  
  <p>So for example if I enter in a new record with <code>MasterCategoryDesc</code> = 'Town' it will insert '4' in <code>MasterCategoryID</code> with the respective <code>SubCategoryDesc + ID</code>.</p>
  
  <p>CAN I SIMPLIFY THIS QUESTION BY REMOVING THE SubCategoryDesc and SubCategoryID columns. How can I achieve this now just with the 2 columns MasterCategoryID and MasterCategoryDesc</p>