I have a field name stored in the database. I would like to check if this field exists in my JSON in Angular 13 app. In XML I would do this: myXmlDoc.SelectSingleNode("/My_RootNode/id")
Is it possible with JSON?
I have a field name stored in the database. I would like to check if this field exists in my JSON in Angular 13 app. In XML I would do this: myXmlDoc.SelectSingleNode("/My_RootNode/id")
Is it possible with JSON?
1条答案
按热度按时间zbq4xfa01#
You can do this using
JSON_VALUE
directly in SQL Server.If the
id
property is actually an object or array (as opposed to scalar) then useJSON_QUERY
In SQL Server 2022 you can use
JSON_PATH_EXISTS
for both cases