SSMS -> Visually format JSON/XML while Developing?

BusyBody2022 121 Reputation points
2021-03-23T13:47:42.613+00:00

Hello....

I am writing some query with JSON being return. The output of course, looks like this:

80675-image.png

When I click on the highlighted data, it would be nice if I saw something like this, instead of one really-long line:

80733-image.png

Is that possible? Would be awfully handy.

Thanks!

Developer technologies Transact-SQL
SQL Server Other
0 comments No comments
{count} vote

Accepted answer
  1. Michael Taylor 60,161 Reputation points
    2021-03-23T14:34:58.23+00:00

    Not in SSMS that I'm aware of. Note that a tooltip may be good for small JSON sets but for large sets it would not fit well. But I do agree looking at formatted data like XML or JSON is painful in the query results.

    Azure Data Studio doesn't support this either yet but it is extensible, definitely more than SSMS, and therefore could be updated to support something like this. Alternatively you can save the result as JSON (an option in ADS) and then load the JSON file into your favorite browser.


1 additional answer

Sort by: Most helpful
  1. Ronen Ariely 15,206 Reputation points
    2023-03-31T04:00:52.6333333+00:00

    Hi,

    It is exists since the private preview of SQL Server 2016 and was released first time in 2016 by Ronen Ariely (yes me). The last version fits SSMS 14,15,16,18,19 (last version of SSMS) and all my clients use it

    In 2016, during the SQLSaturday #481 conference, I used it in my session about JSON and I gave the extension to anyone who came to my lecture and asked for it:

    https://sqlsaturday.com/2016-04-04-SQLSat-0481/

    Several months ago I present in .Net conference how to develop extensions to SSMS and this was one of the demo code I showed fully. All you need to do is to search google and check the first reasult: https://www.google.com/search?q=ssms+.net+ronen+ariely

    or use the direct link to my blog: https://ariely.info/Blog/tabid/83/EntryId/333/Ariely-SSMS-Extension.aspx

    where you can download the extension and the code.

    Note! This was developed for my personal use and any use is on your responsibility :-)

    This is how it's looks when installed:

    Image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.