Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在sql server中解析Json值_Json_Parsing - Fatal编程技术网

在sql server中解析Json值

在sql server中解析Json值,json,parsing,Json,Parsing,我正在使用sqlserver 2012。我的tablebindings包含以下数据 e_id f_id value 1001 1 [{"id":85574},{"id":169794},{"id":151336}]') 1002 1 [{"id":85574},{"id":169794}]') i want to select e_id and value(parsed value) from the above table

我正在使用sqlserver 2012。我的tablebindings包含以下数据

e_id     f_id      value

1001     1         [{"id":85574},{"id":169794},{"id":151336}]')
1002     1         [{"id":85574},{"id":169794}]') 

i want to select e_id and value(parsed value) from the above table.

Sample output.

e_id            value

1001            85574
1001            169794
1001            151336
1002            85574
1002            16974
我尝试使用在中找到的parsejson函数UserDefined函数


无法解析表中的值。

我认为您必须首先在服务器端用c解析这个json,然后在数据库中只插入值部分

我认为您必须首先在服务器端用c解析这个json,然后在数据库中只插入值部分

select StringValue from parsejson('[{"id":85574},{"id":169794},{"id":151336}]')->This query Returns result.

select e_id,(Select stringvalue from parseJSON(v1.value)) from bindings v1 where  v1.value<>'' and v1.f_id=1 

showing error message Subquery returned more than 1 value"

 Below query also.

select (select stringvalue from parseJSON(v1.value)) from bindings v1 where f_id=1