cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

openjson operator

Baron
Participant
4,006

Is there any equivalent to the OPENXML operator for the case of JSON?

I looked in the documentation for something like OPENJSON but couldn't find!!

Any ideas please?

View Entire Topic
Baron
Participant

But at the end it worked! I only needed to add parentheses.

begin

declare json_data long varchar;

set json_data = '{"id":10, "Product_Name":"testname", "Product_Colors":{"color":"white", "background":"black"}}';

call sp_parse_json ('sql_array', json_data);

select (sql_array.Product_Colors).color;

end