Forum Discussion
brunosimoes
May 09, 2024Copper Contributor
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 a...
olafhelper
May 10, 2024Bronze Contributor
select "Save Result As ...", select a path, and give my file a name with JSON extension.
brunosimoes , just changing the file extention don't change the file format and default for export is CSV, so yes, you get additional semicolons, which are not valid for JSON.
No bug, that's how the export works.
Note, SSMS is mainly for managing SQL Server, not intended for such tasks.
- brunosimoesMay 12, 2024Copper Contributor
olafhelper Thank you.
Any effective way to convert the query result into a valid JSON in SQL Serevr?
- olafhelperMay 13, 2024Bronze Contributor
brunosimoes SQL Server already returns valid JSON, your way to export it breaks the result.
- olafhelperMay 14, 2024Bronze ContributorEasier way: Right-mouse click in query window => Result to => Result to text, execute query and copy result to an text editor.