title: Reading json array into rows in SQL Server
body: <p>Given the sample json data below, how can I write a query to pull the array data all in one step? My goal is to have one row for each item in the ActionRecs array (4). My actual json is more complicated but I think this gives a good example of my goal.</p>
  
  <pre><code>declare @json2 nvarchar(max)
  set @json2 = '{
      "RequestId": "1",
      "ActionRecs": [
          {
              "Type": "Submit",
              "Employee": "Joe"
          },
          {
              "Type": "Review",
              "Employee": "Betty"
          },
          {
              "Type": "Approve",
              "Employee": "Sam"
          },
          {
              "Type": "Approve",
              "Employee": "Bill"
          }
      ]
  }'
  
  SELECT x.*
  , JSON_QUERY(@json2, '$.ActionRecs') as ActionArray
  from OPENJSON(@json2) 
  with (Id varchar(5) '$.RequestId') as x
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/pKNd8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pKNd8.png" alt="Query Reults"></a></p>