How to build JSON with selected fields from JSON columns in SQL Server keeping fields type
I have JSON like this: { "_key": { "id": "3b8d1ed7-c3ec-32ec-a083-2ddc17152e94", "rootId": "15c85327-9628-3685-b84a-375b546ba92a" }, "employeeInfo": { "idNumber": "3", "gender": "Male", "active": true, "age": 20 }, "product": { "plan": "prod", "class": "1", "available": true, "_type": "Product" } } And I want to…