SQL Server - JSON类型枚举

时间:2018-05-04 12:09:44

标签: sql json sql-server

鉴于

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 列值及其相应含义的枚举。

请指出正确的方向;感谢。

1 个答案:

答案 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