I am trying to output JSON via tsql hierarchy table.
Code:
select Field1, Field2 from @header inner join @line on @header.Id = @Line.Id FOR JSON AUTO
I am getting:
"Field1": "BOB",
"Field2": "BOB2",
but I am looking for it to display
"Field1": {
"value": "BOB"
},
"Field2": {
"value": "BOB2"
},
What am I doing wrong? I can using text manipulation, but was wondering if there is a "blessed" way, i.e. built-in that is readable and best-practice.