Merge Customers Failed. Violation of Primary Key Constraint on T_CREDITEE

Hello, We are having a hard time with our merge-customer scheduled job (the job that runs [AP_MERGE_CUSTOMER2]). Any help on this would be very much appreciated. This job usually runs on Sundays, but as of two weeks ago, it has started to fail, complaining about Violation of Primary Key on dbo.T_CREDITEE. Below is the full error message in the logs: The job failed. The Job was invoked by Schedule 15 (Sunday at 10:59PM). The last step to run was step 1 (Merge Customers). Violation of PRIMARY KEY constraint 'PK_T_CREDITEE_1__18'. Cannot insert duplicate key in object 'dbo.T_CREDITEE'. [SQLSTATE 23000] (Error 2627) The statement has been terminated. [SQLSTATE 01000] (Error 3621). The step failed. At this point, our guess was that two accounts that are scheduled to be merged both have soft credits which results in a primary key violation after merge. Looking at the T_CREDITEE table, there are only two rows with dates after February (the first time the merge started to fail). We'll call them accounts 1234 and 5678. The problem is that neither of these two accounts are scheduled to be merged. The following query SELECT * FROM [dbo].[TW_POTENTIAL_DUPS] where customer_no = 1234 or customer_no = 5678 or keep_cust = 1234 or keep_cust = 5678 returns no records. Does anyone know what we are missing here? What is causing the primary key violation on T_CREDITEE?
Parents Reply Children
No Data