A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
If empID is unique, then try something like this:
select empId, json_query( concat('[', age, ']')) as age
from employee for json auto
In SQL 2022 you can use the new JSON_ARRAY function.