title: SQL Server 2005 Using CHARINDEX() To split a string
body: <p>How can I split the following string based on the '-' character?</p>
  
  <p>So if I had this string:     <code>LD-23DSP-1430</code></p>
  
  <p>How could I split it into separate columns like this:</p>
  
  <pre><code>LD        23DSP       1430
  </code></pre>
  
  <p>Also, is there a way to split each character into a separate field if I needed to (without the '-')? I'm trying to find a way to replace each letter with the NATO alphabet.</p>
  
  <p>So this would be..... Lima Delta Twenty Three Delta Sierra Papa Fourteen Thirty.... in one field.</p>
  
  <p>I know I can get the left side like this:</p>
  
  <pre><code>LEFT(@item, CHARINDEX('-', @item) - 1)
  </code></pre>