title: Table Function to Parse out array data
body: <p>I am having some trouble trying to split out the array string that I have stored in a SQL Table field "SQL Server 2014".</p>
  
  <p>My data looks like </p>
  
  <pre><code>array(
                              "status"=&gt;array("pre"=&gt;"2","aft"=&gt;1)
                              "tier_ppl"=&gt;array("pre"=&gt;5.00,"aft"=&gt;5.00)
                              "tier_commission"=&gt;array("pre"=&gt;5.00,"aft"=&gt;500.00)
                              "tier_commission_datetime"=&gt;array("pre"=&gt;"2017-02-10 12:30:59","aft"=&gt;"2017-02-14 08:54:32")
                              "affiliate_commission"=&gt;array("pre"=&gt;4.00,"aft"=&gt;4.00)
                              "affiliate_commission_datetime"=&gt;array("pre"=&gt;"2017-02-10 12:30:59","aft"=&gt;"2017-02-10 12:30:59")
                          )
  </code></pre>
  
  <p>And I need to make my out put look like :-</p>
  
  <pre><code>arrayname                      pre                           aft
  
  status                         5.00                          5.00
  
  tier_ppl                       5.00                          500.00
  
  tier_commission                5.00                          500.00
  
  tier_commission_datetime       2017-02-10 12:30:59           2017-02-14 08:54:32
  
  affiliate_commission           4.00                          4.00
  
  affiliate_commission_datetime  2017-02-10 12:30:59           2017-02-10 12:30:59
  </code></pre>
  
  <p>Each record that I have will have an array such as this though sometimes the pre or the aft will be blank.  I have tried going down the split function route but I am unable to make my data look the way I want it to, has anyone done something like this before that can help please.</p>
  
  <p>Thanks </p>