title: Apply OPENJSON to a single column
body: <p>I have a products table with two attribute column, and a json column. I'd like to be able to delimit the json column and insert extra rows retaining the attributes. Sample data looks like:</p>
  
  <pre><code>ID          Name          Attributes
  1           Nikon        {"4e7a":["jpg","bmp","nef"],"604e":["en"]}
  2           Canon        {"4e7a":["jpg","bmp"],"604e":["en","jp","de"]}
  3           Olympus      {"902c":["yes"], "4e7a":["jpg","bmp"]}
  </code></pre>
  
  <p>I understand OPENJSON can convert JSON objects into rows, and key values into cells but how do I apply it on a single column that contains JSON data?</p>
  
  <p>My goal is to have an output like:</p>
  
  <pre><code>ID          Name          key        value
  1           Nikon         902c       NULL
  1           Nikon         4e7a       ["jpg","bmp","nef"]
  1           Nikon         604e       ["en"]
  2           Canon         902c       NULL
  2           Canon         4e7a       ["jpg","bmp"]
  2           Canon         604e       ["en","jp","de"]
  3           Olympus       902c       ["yes"]
  3           Olympus       4e7a       ["jpg","bmp"]
  3           Olympus       604e       NULL
  </code></pre>
  
  <p>Is there a way I can query this products table like? Or is there a way to reproduce my goal data set?</p>
  
  <pre><code>SELECT
    ID,
    Name,
    OPENJSON(Attributes)
  FROM products
  </code></pre>
  
  <p>Thanks!</p>