Use the tool of your choice to create the class objects for the json schema. Then map the database rows to the new objects. Your sql will return the tables as a product, which you will need to remap to a hierarchy. You could also use Sqlserver json support
to build the json string,
All-Star
58444 Points
15778 Posts
Re: How to create Json according to below Schema
Feb 08, 2021 03:35 PM|bruce (sqlwork.com)|LINK
Use the tool of your choice to create the class objects for the json schema. Then map the database rows to the new objects. Your sql will return the tables as a product, which you will need to remap to a hierarchy. You could also use Sqlserver json support to build the json string,