title: Is there a way to query JSON column in SQL Server ignoring capitalization of keys?
body: <p>I am trying to query a JSON column that has mixed capitalization.  For instance, some rows have keys that are all lower case like below:</p>
  
  <pre><code>{"name":"Screening 1","type":"template","pages":[{"pageNumber":1,...}
  </code></pre>
  
  <p>However, some of the rows have keys that are capitalized on its first letter like this:</p>
  
  <pre><code>{"Type":"template","Name":"Screening2","Pages":[{"PageNumber":1,...}
  </code></pre>
  
  <p>Unfortunately, SQL Server seems to only supports JSON path system that is case sensitive.  Therefore, I can't query on all rows successfully.  If I use lower case path like '$.pages' in a query like below:</p>
  
  <pre><code>SELECT ST.Id AS Screening_Tool_Id
      , ST.Name AS Screening_Tool_Name
      , ST.Description AS Screening_Tool_Description
      , COUNT(JSON_VALUE (SRQuestions.value, '$.id'))  AS Question_Specific_Id
  
  FROM dbo.ScreeningTemplate AS ST
      CROSS APPLY OPENJSON(ST.Workflow, '$.pages') AS SRPages
          CROSS APPLY OPENJSON(SRPages.Value, '$.sections') AS SRSections
  </code></pre>
  
  <p>I miss any row that has capitalized keys.  Is there any way to query all rows ignoring their capitalization?</p>