FOR JSON AUTO Query returning broken headers
Hello all,
I wanted to confirm if there’s anything I’m doing wrong or if this is actually a bug.
I am using SQL Server Express 2022 version 16.0.1000.6 with all patches installed. I am sharing a copy of the database as it is right now if anyone wants to test it:
When I run the following query:
SELECT [Datetime]
,[Temperature]
,[Snow]
,[SolarRadiation]
,[UVIndex]
,[Visulazation]
,[Description]
,[WindSpeed]
,[Sunrise]
,[Sunset]
,[Precipitation]
,[City]
,[Country]
,[Pressure]
,[Wind_Direction]
,[FeelsLike]
FROM [WeatherStation].[dbo].[Weather]
ORDER BY [Datetime] DESC
FOR JSON AUTO
I get the JSON result, then I right-click on SSMS where the result is shown and select “Save Result As …”, select a path, and give my file a name with JSON extension.
When I open the file, I get lines 223 without JSON formatting, line 658 with a space or line break on “Description” and on line 767 I get a space or line break for the “Light Rain” record.
I am opening the file with Visual Sutdio code.
Are my records broken and need adjustment? My query needs adjustments? Any suggestions on how to proceed?
Hello all, I wanted to confirm if there’s anything I’m doing wrong or if this is actually a bug. I am using SQL Server Express 2022 version 16.0.1000.6 with all patches installed. I am sharing a copy of the database as it is right now if anyone wants to test it: DatabaseBackup When I run the following query:SELECT [Datetime]
,[Temperature]
,[Snow]
,[SolarRadiation]
,[UVIndex]
,[Visulazation]
,[Description]
,[WindSpeed]
,[Sunrise]
,[Sunset]
,[Precipitation]
,[City]
,[Country]
,[Pressure]
,[Wind_Direction]
,[FeelsLike]
FROM [WeatherStation].[dbo].[Weather]
ORDER BY [Datetime] DESC
FOR JSON AUTO I get the JSON result, then I right-click on SSMS where the result is shown and select “Save Result As …”, select a path, and give my file a name with JSON extension. When I open the file, I get lines 223 without JSON formatting, line 658 with a space or line break on “Description” and on line 767 I get a space or line break for the “Light Rain” record. I am opening the file with Visual Sutdio code. Are my records broken and need adjustment? My query needs adjustments? Any suggestions on how to proceed? Read More