Mistake: treating an array like an object. JSON_VALUE() extracts one scalar from a JSON document, but its path must include the array index. Without [0], '$.EmployeeAddress[0].EmployeeID' becomes NULL—even when the array contains one record. section 3.5
Updating an employee address
When address data arrives as JSON, use JSON_VALUE() in the WHERE clause to identify the employee: UPDATE dbo.Employees SET Address = @EmployeeAddress WHERE EmployeeID = JSON_VALUE(@EmployeeAddress, '$.EmployeeAddress[0].EmployeeID'); The path starts with $. for the whole document, then navigates through the EmployeeAddress array. section 3.5
