title: SQL Trigger to split string during insert without a common delimiter and store it into another table
body: <p>Currently I have a system that is dumping data into a table with the format:</p>
  
  <pre><code>Table1
  Id#, row#, row_dump
  222, 1, “set1  = aaaa     set2 =aaaaaa  aaaa  dd set4=1111”
  </code></pre>
  
  <p>I want to take the row dump and transpose it into rows and insert it into another table of the format:</p>
  
  <pre><code>Table2
  Id#, setting, value
  222, ‘set1’,’aaa’ 
  222, ‘set2’,’aaaaaa  aaaa  dd’
  222, ‘set4’,’1111’
  </code></pre>
  
  <p>Is there a way to make a trigger in MSSQL that will parse this string on insert in Table1 and insert it into Table2 properly?</p>
  
  <p>All of the examples I’ve found required a common delimiter. ‘=’ separates the setting from the value, space(s) separate a value from a setting but a value could have spaces in it (settings do not have spaces in them so the last word before the equal sign is the setting name but there could be spaces between the setting name and equal sign). </p>
  
  <p>There could be 1-5 settings and values in any given row. The values can have spaces. There may or may not be space between the setting name and the ‘=’ sign. </p>
  
  <p>I have no control over the original insert process or format as it is used for other purposes. </p>