$LISTBUILD (IDs of referenced objects) should do the trick. The "parent" table here is only storing the corresponding IDs not the entire objects. You need to save each object individually and then link them.
While the object counterpart takes care of saving/inserting both objects in memory, the same is not true for SQL. You need to treat each object as individual rows on different tables.
Have you tried "jobbing" the routine from the CSP?
Certifications & Credly badges:
Warlin has no Certifications & Credly badges yet.
Global Masters badges:
![Open Sesame!](https://community.intersystems.com/sites/default/files/badges/303371180-6de11138-f4e7-4113-b5cc-836269f07693.png)
![1,000 Points](https://community.intersystems.com/sites/default/files/badges/290121674-53216c4b-fe0c-44e7-9d75-2f24390135ed.png)
![Challenge Starter](https://community.intersystems.com/sites/default/files/badges/295959213-b83dd91a-663f-4f07-8e0e-e3287b7c2309.png)
![DC Commenter](https://community.intersystems.com/sites/default/files/badges/dc_commenter_1.png)
![DC Problem Solver](https://community.intersystems.com/sites/default/files/badges/dc_problem_solver_1.png)
![Master of Answers](https://community.intersystems.com/sites/default/files/badges/master_of_answers.png)
![Bronze Master of Answers](https://community.intersystems.com/sites/default/files/badges/bronze_master_of_answers.png)
Followers:
Warlin has no followers yet.
Following:
Warlin has not followed anybody yet.
The "only" way to do this via SQL would be using stored procedures. You can pass your object tree using either XML or JSON string and process them (using object logic) inside your SP. Standard SQL as intended won't support what you want to achieve.