Skip to content
Advertisement

Complex multi-level JSON and SQL – what am I doing wrong?

So I am able to query my JSON file fine then I wanted to add another field that is under a few levels and when I try to do this – it doesn’t work. What am I doing wrong?

So the following works correctly and gives me back the first level promoter id

This does not work – I get all my fields back except that darn promoter id

Advertisement

Answer

answering my own question – I finally figured it out with help from this site – https://sqlwithmanoj.com/2015/11/01/reading-json-string-with-nested-elements-sql-server-2016-part-3/

This is what works –

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