鉴于
declare @json varchar(max)='{
"name":"John",
"age":30,
"cars": [
{ "make":"Ford", "models":[ "Fiesta", "Focus", "Mustang","Vintage"] ,"price":[1100,200,300,999]},
{ "make":"BMW", "models":[ "320", "X3", "X5" ] },
{ "make":"Fiat", "models":[ "500", "Panda" ] }
] }';
查询
select * from openjson(@json,'$')
返回3列:
key value type
我没有找到 type 列值及其相应含义的枚举。
请指出正确的方向;感谢。
答案 0 :(得分:3)
From the MSDN page for OPENJSON:
Value of the Type column JSON data type
0 null
1 string
2 int
3 true/false
4 array
5 object