title: SQL to JSON - array of objects to array of values in SQL 2016
body: <p>SQL 2016 has a new feature which converts data on SQL server to JSON. I am having difficulty in combining array of objects into array of values i.e., </p>
  
  <p>EXAMPLE - </p>
  
  <pre><code>CREATE TABLE #temp (item_id VARCHAR(256))
  
  INSERT INTO #temp VALUES ('1234'),('5678'),('7890')
  
  SELECT * FROM #temp
  
  --convert to JSON
  
  SELECT (SELECT item_id 
  FROM #temp
  FOR JSON PATH,root('ids')) 
  </code></pre>
  
  <p>RESULT - </p>
  
  <pre><code>{
      "ids": [{
          "item_id": "1234"
      },
      {
          "item_id": "5678"
      },
      {
          "item_id": "7890"
      }]
  }
  </code></pre>
  
  <p>But I want the result as - </p>
  
  <pre><code>"ids": [
          "1234",
          "5678",
          "7890"
      ]
  </code></pre>
  
  <p>Can somebody please help me out?</p>