I believe this is quite a small issue that I’m running into it, but I’m at a loss as to why I can’t return the “id” value within the JSON. What reference am I missing considering the total_pages select returns just fine.
DECLARE @json NVARCHAR(MAX);
SET @json = N'{
"data": [
{
"id": 1450
},
{
"id": 1451
}
],
"total_pages": 1
}
';
SELECT
*
FROM
OPENJSON(@json) WITH (
id INT 'strict $.total_pages'
)
SELECT
*
FROM
OPENJSON(@json) WITH (
id INT 'strict $.data.id'
)