JsonPath Array

  • Hi,

    i read a JSON-File into a var.

    SELECT @json = BulkColumn FROM OPENROWSET(BULK 'C:\Tmp\MyJson.json', SINGLE_CLOB) AS j;

    The Json looks like this:

    {

    "d": {

    "results": [

    {

    "__metadata":

    {

    "id": "http://xxxx('900000856')",

    "uri": "http://xxxx('900000856')",

    "type": "businessPartner"

    },

    "businessPartnerNumber": "1111111111",

    "origin": ""

    },

    {

    "__metadata": {

    "id": "http://xxxx('1000002000')",

    "uri": "http://xxxx('1000002000')",

    "type": "Z_AZURE_SRV.businessPartner"

    },

    "businessPartnerNumber": "2222222222",

    "origin": "AL"

    }

    ]

    }

    }

    My Code returns NULL  🙁 . Can you tell me, what's wrong with my json.path?

    SELECT *

    FROM

    OPENJSON(@JSON)

    WITH

    (

    businessPartnerNumber VARCHAR(200) '$.results.businessPartnerNumber'

    ,origin VARCHAR(200) '$.results.origin'

    );

    Thanks

    Regards

    Nicole

     

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply