Datamart refresh fails with Description: "Violation of PRIMARY KEY constraint 'PK_CONSTITUENTPREFERRED'

When refreshing the datamart in Blackbaud Direct Marketing and the refresh fails with the following error:"Violation of PRIMARY KEY constraint 'PK_CONSTITUENTPREFERRED'.  Error is seen in the status log.  This is information from a RE database to a BBDM database. 
This is because in the RE database there are one or more constituents with multiple primary addresses.


Run the following script against the RE database:

select COUNT (PREFERRED)as Preferred,CONSTIT_ID
from constit_address
where PREFERRED = '-1'
group by CONSTIT_ID
having COUNT (Preferred) >1
 
 
then take those results and fill in the ids in this script
 
select first_name, last_name, org_name, constituent_id, id
from RECORDS
where ID in ('ID1',
'ID2');
 
If there is only ID returned just delete the comma and ‘ID2’ portion and enter the one ID into the ID1 field.  This will return the records that have duplicates.  They may actually get more than the one they see in the error logs as well. 

Find the constituent in question and remove the second primary address from their record.

Environment

 Blackbaud Direct Marketing
 4.0
 4.0.131.2

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.