Set a column value as key in JSON output
Suppose I have this SQL working: SELECT( SELECT a.id, a.label, a.text FROM [data] a FOR JSON PATH, INCLUDE_NULL_VALUES ) AS 'data' which will produce JSON with this structure: [ { "id": "N/A", "label": "test", "text": "Not applicable" }, { "id":…