Search code examples
jsonsql-serverssmssql-server-2016for-json

SQL Server 2016 SSMS Json Formatting


I am working with JSON in SSMS in SQL Server 2016. Is there any way to get around that the results of a FOR JSON statement are presented as an XML column?

Are there any settings changes, additional components, external tools, etc. or even hacks to make this less painful?

In my ideal world, clicking on a JSON column (or an XML column for that matter) would open in my text editor of choice, such as Visual Studio Code, with SSMS knowing that the string in the column is JSON and saving it to file with a .json extension.


Solution

  • Azure Data Studio will do most of what you want.

    Run your query:

    enter image description here

    Clicking on the RESULTS will open a new tab with formatted JSON:

    enter image description here