I would like to know if this is normal behavior of SQL Server (on Azure). My SQL query returns JSON using FOR JSON PATH and nested queries. My problem is that it seems that depending on the length of the resulting JSON, the result is separated into multiple rows.
This is a problem since the number of rows might change depending on the data. I would also have to concat all the rows together manually to have a valid JSON.
A workaround is to put the resulting JSON into a variable and select it after hand. This results in a single row and column (so I know it is not a max length issue).
Is this normal behavior or is there a problem with my query?