I am using the following Append query:
INSERT INTO EMPLOYEE_ROLES ( emp_id, role_code, local_role_code, primary_role_flg )
SELECT [User Roles TEST].emp_id, [User Roles TEST].GENERIC, [User Roles TEST].ROLE, 'Yes' AS Expr1
FROM [User Roles TEST];
The first two fields in EMPLOYEE_ROLES are primary keys. The User Roles TEST table contains records where the emp_id matches existing records in EMPLOYEE_ROLES, but the GENERIC data value does not - yet the record does not get added due to key violations. The fields in both tables have the same format.
If the incoming emp_id/GENERIC combination does not exist in EMPLOYEE_ROLES, why would the record not be added?
INSERT INTO EMPLOYEE_ROLES ( emp_id, role_code, local_role_code, primary_role_flg )
SELECT [User Roles TEST].emp_id, [User Roles TEST].GENERIC, [User Roles TEST].ROLE, 'Yes' AS Expr1
FROM [User Roles TEST];
The first two fields in EMPLOYEE_ROLES are primary keys. The User Roles TEST table contains records where the emp_id matches existing records in EMPLOYEE_ROLES, but the GENERIC data value does not - yet the record does not get added due to key violations. The fields in both tables have the same format.
If the incoming emp_id/GENERIC combination does not exist in EMPLOYEE_ROLES, why would the record not be added?