Error: An error occurred before executing the process 'Constituent Duplicate Search Business Process' Violation of PRIMARY KEY constraint #TMPxx. Cannot insert duplicate key in object 'dbo#TMP_CONSTITUENTS'

When running the Full Constituent Duplicate Search Process you may encounter the constraint error "An error occurred before executing the process 'Constituent Duplicate Search Business Process' Violation of PRIMARY KEY constraint #TMPxx. Cannot insert duplicate key in object 'dbo#TMP_CONSTITUENTS'"
This error can be caused by bad data. For example, if a household has more than one primary member or a group has duplicate group members (the same individual is listed as a group member multiple times). The first script below can be used to identify the duplicate primary members and their households. The second script below will look group duplicate group members. After fixing the constituents listed in the script results from the constituents from the script results or excluding them in the constituent selection, run the Constituent duplicate search process again.
 
Select C.Name,C.LOOKUPID, H.LOOKUPID as Householdlookup, CH.ISPRIMARYMEMBER from CONSTITUENTHOUSEHOLD CH
Join CONSTITUENT C on C.ID= CH.ID
join CONSTITUENT H on H.ID=CH.HOUSEHOLDID
where CH.HOUSEHOLDID IN
( Select householdID from CONSTITUENTHOUSEHOLD where isprimarymember='1'
 group by HOUSEHOLDID having count(*) >1)
 And CH.ISPRIMARYMEMBER='1'
 order by CH.HOUSEHOLDID

select GROUPID, MEMBERID, count(*)
from dbo.GROUPMEMBER GM
group by GROUPID, MEMBERID
having count (*) > 1
 

Steps to Duplicate

1. Navigate to Constituents > Duplicates.
2. Run the Full Constituent Duplicate Search Process.
3. Note the constraint error.
 

Environment

 Blackbaud CRM
 4.0
 4.0.170.41

Was this article helpful?


Thanks for your feedback! Did this solve your issue?

Comments (optional):


Thanks for your feedback!
We're glad it was helpful but sorry it didn’t solve your issue. If you need assistance, click Chat with Support below.
We’re sorry to hear that. Please tell us why.

 I don't like how this works.

 The answer is confusing.

 The answer didn't match what I was searching for.

Additional Comments (optional):


Thanks for your feedback! If you need assistance, click Chat with Support below.
Thanks for your feedback. Help us make our products even better by sharing details in our Idea Banks or our online Community.
Thanks for letting us know. We'll work on clarifying the information in the article. If you need assistance, click Chat with Support below.
Thanks for letting us know. We'll work on updating the search engine to return more relevant results.