dcsimg
Results 1 to 1 of 1

Thread: Property not found in the specified JSON path

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2016
    Location
    China
    Posts
    186

    Property not found in the specified JSON path

    Code:
    DECLARE @json nvarchar(max)
    SET @json='{"isok":"true","stateNumber":"1","data":"{\"ok\":true,\"tables\":[{\"RN\":\"1\",\"ORDERID\":\"2019775285\",\"USERID\":\"3486\",\"USERNAME\":\"yyshst\",\"TRUENAME\":\"www\",\"ADDRESS\":\"童装城\",\"PHONE\":\"155852352\",\"MOBILE\":\"155852352\",\"TOTALPRICE\":\"1805.3\",\"TOTALNUM\":\"5\",\"SENDTIME\":\"2019/7/10 14:23:23\",\"STATE\":\"2\",\"INSERTTIME\":\"2019/7/10 14:23:23\",\"ORDERTARGET\":\"5\",\"DNY\":\"aa\",\"DEFULTP\":\"1\",\"XLH\":\"50081793\",\"REMARK\":\"\",\"XJBZ\":\"1\",\"ERPUSERID\":\"c4519\",\"KHMC2\":\"公司\",\"JE3\":\"\"},{\"RN\":\"2\",\"ORDERID\":\"20131846\",\"USERID\":\"295541\",\"USERNAME\":\"hygc\",\"TRUENAME\":\"cc\",\"ADDRESS\":\"陡沟村\",\"PHONE\":\"1361094\",\"MOBILE\":\"361094\",\"TOTALPRICE\":\"261.7\",\"TOTALNUM\":\"2\",\"SENDTIME\":\"2019/7/10 14:18:43\",\"STATE\":\"2\",\"INSERTTIME\":\"2019/7/10 14:18:43\",\"ORDERTARGET\":\"5\",\"DNY\":\"cc\",\"DEFULTP\":\"1\",\"XLH\":\"501792\",\"REMARK\":\"\",\"XJBZ\":\"1\",\"ERPUSERID\":\"03230\",\"KHMC2\":\"限责任公司\",\"JE3\":\"\"}]}","records":"454","pcounts":"227","nzsum":"总金额 :0.00","sum":"本页总金额:2067.00","zsum":"条件查询总金额:0.00"}'
    declare @s nvarchar(max)
    
    select * from openjson(@json,'strict $.data.tables')
    This code prompts an error: Property not found in the specified JSON path,

    Is my SELECT code error or JSON error?
    Last edited by ChenLin; Jul 10th, 2019 at 07:25 PM. Reason: Undo this problem, reason: JSON source is not standardized
    QQ: 289778005

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width