title: Reading JSON file using a SQL Server 2016 query - child records issue
body: <p>I have the following JSON file named (<strong>C:\temp\test.json</strong>) that has a main record and three child records structured like this:</p>
  
  <pre><code> [{ 
    "dc:type":{ 
       "dc:title":"AMC",
       "dc:type":"recordType",
       "rdf:resource":"https://tmkl.at1/16777434"
    },
    "dc:title":"CCP00113620",
    "RM_Approved_on":"2011-12-19T13:04:36Z",
    "Title":"RAM PROGRAM PLAN",
    "Project":{ 
       "oslc_cm:label":"HTLS",
       "rdf:resource":"https://tmkl.at1/16789988-34271859"
    },
    "Drawing":"N",
    "Attachments":{ 
       "oslc_cm:results":[ 
          { 
             "rdf:about":"https://tmkl.at1/16777434-33668052/field/Attachments/attachment/16782994-34738717",
             "dc:type":{ 
                "dc:title":"AMC",
                "dc:type":"recordType",
                "rdf:resource":"https://tmkl.at1./16777434"
             },
             "dc:title":"Doc-review-sheet-CCP00113620.xls",
             "filename":"Doc-1234-CCP00113620.xls"
          },
          { 
             "rdf:about":"https://tmkl.at1/16777434-33668052/field/Attachments/attachment/16782994-34736984",
             "dc:type":{ 
                "dc:title":"AMC",
                "dc:type":"recordType",
                "rdf:resource":"https://tmkl.at1./16777434"
             },
             "dc:title":"Doc-review-sheet-CCP00113620-JD.xls",
             "filename":"Doc-CCP00113620-JD300.xls"
          },
          { 
             "rdf:about":"https://tmkl.at1/16777434-33668052/field/Attachments/attachment/16782994-34738722",
             "dc:type":{ 
                "dc:title":"AMC",
                "dc:type":"recordType",
                "rdf:resource":"https://tmkl.at1./16777434"
             },
             "dc:title":"3CU 05007 0009 UMZZA-Rev01-B_edited.doc",
             "filename":"UMZZA-Rev01-B_edited.doc"
          }
       ],
       "oslc_cm:collref":"https://tmkl.at1/16777434-33668052/field/Attachments"
    },
    "rdf:about":"https://tmkl.at1/16777434-33668052"
   },
   { 
      "dc:type":{ 
         "dc:title":"AMC",
         "dc:type":"recordType",
         "rdf:resource":"https://tmkl.at1./16777434"
      }]
  </code></pre>
  
  <p>I would like to read this file (<strong>C:\temp\test.json</strong>) using a sql SQL Server 2016 query and obtain the following result:</p>
  
  <pre><code>id                Project      Title             Filename        Web-address  
  CCP00113620         HTLS       RAM PROGRAM PLAN   Doc-1234-CCP00113620.xls https://tmkl.at1/16777434-33668052/field/Attachments/attachment/16782994-34738717
  CCP00113620         HTLS       RAM PROGRAM PLAN   Doc-CCP00113620-JD300.xls https://tmkl.at1/16777434-33668052/field/Attachments/attachment/16782994-34736984
  CCP00113620         HTLS       RAM PROGRAM PLAN   UMZZA-Rev01-B_edited.doc  https://tmkl.at1/16777434-33668052/field/Attachments/attachment/16782994-34738722
  </code></pre>
  
  <p>I tried the following query :</p>
  
  <pre><code>SELECT ecn_att.*,q1.* 
  FROM OPENROWSET (BULK 'd:\temp\ecn_att.json', SINGLE_CLOB) as j 
  CROSS APPLY OPENJSON(BulkColumn) 
  WITH( 
        [id] [varchar](16), 
        [Project] [varchar](200), 
        [Title] [varchar](200), 
        [Attachments] nvarchar(max) AS JSON   
   ) AS ecn_att 
  CROSS APPLY OPENJSON ([Attachments]) 
  WITH (
        [dc:type] [varchar](max)
  ) as Q1
  </code></pre>
  
  <p>I am unable to get the child records</p>