Hi, I am using Azure Synapse Analytics to output a JSON document from the results of a table. The below query works in SQL Server. Could you please guide to work around using Synapse Analytics pool.
DROP TABLE IF EXISTS #Data
CREATE TABLE #Data ([Id] int, [Description] varchar(150))
INSERT INTO #Data VALUES (1, 'Test 1'), (2, 'Test 2'), (3, 'Test 3')
SELECT (SELECT [Id],
[Description]
FROM #Data
FOR JSON PATH, root('data'))
JSON
{
"results":[
{
"Id":1,
"Description":"Test 1"
},
{
"Id":2,
"Description":"Test 2"
},
{
"Id":3,
"Description":"Test 3"
}
]
}
What other options are available to output JSON?
Thank you in advance
