Many to Many relationship write Foreign keys to Database

Certified Senior Developer

Hi All,

I currently have 3 tables, managers, employees, and a third table for foreign keys managers_employees where I have a primary key, a foreign key to the managers table and a foreign key to the employees table. When I'm trying to write to the DB I'm having an issue with the employees foreign keys since they can be multiple employees but they all belong to the same manager. So for example my tables should look like this:

managers table: 

ID name

6  Alan, Nus

Employees Table:

ID Name

10  Kim, Perez

11 Luz, Asos

managers_employees table

ID  Manager_key   Employees_key

1        6                       10

2         6                       11

When I'm doing this in my process model in a script task after writing to the employees table, I'm not able to retrieve the employees key correctly. Any expressions or suggestions on how to do this? For the manager key is fine since its the same value repeated.

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data