Skip to content
Advertisement

How can I Select list of list or object of object not like a table? (SQL Server)

I have a problem in SQL Server: I want select list of list or object of object not a table.

Example :

Like a json example :

Is there a solution to this problem for me?

I want to output a stored procedure that I can use for the web service

Advertisement

Answer

Given this sample data:

You can just apply FOR JSON AUTO to your join to get the results you want (well, close):

Output (whitespace mine):

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement