I am using AZURE SQL (SQL Server 2016) and creating a query to give me output in JSON object. I am adding FOR JSON PATH at the end of query.
FOR JSON PATH
When I exe
With thanks to @David Browne. I found I had to use 'print' instead of 'select'
declare @json varchar(max) = (SELECT * FROM dbo.AppSettings FOR JSON AUTO) print @json