title: MSSQL - Split a field into 3 fields
body: <p>I have a resultset consisting of 1 column and in this case 2 rows the single column [ProductDescription] is a varchar field that hold 3 pieces of information (I didn't design it) i need to get those three pieces of information out into 3 additional fields using a query</p>
  
  <p>before</p>
  
  <pre>
  /------------------------------\
  |ProductDescription            |
  |------------------------------|
  |DB1 - DB2 - DB3               |
  |DataBit1 - DataBit2 - DataBit3|
  \------------------------------/
  </pre>
  
  <p>After</p>
  
  <pre>
  /---------------------------------------------------------\
  |Field1  |Field2  |Field3  |ProductDescription            |  
  |---------------------------------------------------------|  
  |DB1     |DB2     |DB3     |DB1 - DB2 - DB3               |  
  |DataBit1|DataBit2|DataBit3|DataBit1 - DataBit2 - DataBit3|  
  \---------------------------------------------------------/
  </pre>
  
  <p>I have tried using combinations of Substring and charindex but haven't been able to get it quite right, each part of the field could be any length so using hardcoded offsets doesn't work.</p>