Parse Data from OPENJSON()

26 Views Asked by At

Here is my string:

SELECT * FROM OPENJSON ('{"data":{"CAD":1.3480102032}}')
WITH ( Rate VARCHAR(200) '$.data')

I need to extract the value 1.3480102032

Sorry, new to this! The result from what I get is NULL. Please help.

1

There are 1 best solutions below

1
Russ On
    select * from OPENJSON ('{"data":{"CAD":1.3480102032}}')
WITH (Rate FLOAT '$.data."CAD"')

CAD needed to be put in quotes as it is a string.