For the unique_events_view, JSON_VALUE is a more appropriate function as we would only ever cast a scalar value to an int anyways.
For the table function, payload is now a json type, so different syntax was more appropriate (also existing code was invalid due to differences in the return type of JSON_QUERY for a json string vs a json expression.
For the unique_events_view, JSON_VALUE is a more appropriate function as we would only ever cast a scalar value to an int anyways.
For the table function, payload is now a json type, so different syntax was more appropriate (also existing code was invalid due to differences in the return type of JSON_QUERY for a json string vs a json expression.