title: SQL Server: split a single row into 2 rows
body: <p>I'm trying to import data from an excel spreadsheet into a SQL Server 2008 database and I need to massage the data a bit first.</p>
  
  <p>I've used the Data Import wizard to load it into a staging table in the database in the following format:</p>
  
  <pre><code>Id  ISOCode  Data
  1   US       Foo
  2   CA       Bar
  3   US or CA Blah
  </code></pre>
  
  <p>In cases where ISO is an OR-delimited string, eg <code>US or CA</code>, I need to split it into 2 rows, so in the final destination table it would look like this:</p>
  
  <pre><code>Id  ISOCode  Data
  1   US       Foo
  2   CA       Bar
  3   US       Blah
  3   CA       Blah
  </code></pre>
  
  <p>I do have a <code>SplitString</code> table-valued function available but I'm not sure how to work it into the equation.</p>