title: Extracting codes from strings in SQL
body: <p>I have a column which contains codes and descriptions and need to split them.</p>
  
  <p>Multiple codes may or may not reside in the field.</p>
  
  <p>Eg;</p>
  
  <pre><code>"CSxxxxx description text here"
  
  "WSxxxxx description text here"
  
  "CSxxxxx, WSxxxxx, CSxxxxx description text here"
  </code></pre>
  
  <p>If there are multiple codes, then the description should be repeated, so the output for row 3 above would be 3 lines inserted into a secondary table.</p>
  
  <p>The codes, for the moment, would always be in the format of:</p>
  
  <pre><code>FixedLetter-FixedLetter-Number-Number-Number-Number-Number 
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>FixedLetter-FixedLetter-Number-Number-Number-Number
  </code></pre>
  
  <p>I can write the regex to identify the first couple, but i'm not familiar with cutting this from the string and inserting to another table?</p>
  
  <p>Thanks,
  Dave</p>