Home Convert table to JSON with an specific path
Reply: 0

Convert table to JSON with an specific path

user768 Published in March 24, 2018, 12:39 am

I'm new with JSON format and i want to convert a Table from SQL to this format, i have something like this:

The row 1 and 2 belongs to the same Product, but the Area Column shows different attributes. TheJSON should have a node for each operation and subnode whit each attribute. I use this code:

    KeyOp, Office, OType, Channel, SubType, Operation
    , Area [Des.Area], IDOperation [Des.IDOperation], Ticket [Des.Ticket]
    , Currency [Des.Currency], Account [Des.Account], Ammount [Des.Ammount] 
FROM dbo.Table1 

but i get this behavior:

Is it possible to join this two lines? I'm using SSMS 2012.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.299479 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO