Error: The DELETE statement conflicted with the REFERENCE constraint "FK_USR_LUMINATE_APPSURVEYRESPONSE_CONSTITUENTID". The conflict occurred in database, table "dbo.USR_LUMINATE_APPSURVEYRESPONSE", column "CONSTITUENTID" - When merging constituents

When merging constituents, you might encounter the error, "Data could not be saved. The DELETE statement conflicted with the REFERENCE constraint "FK_USR_LUMINATE_APPSURVEYRESPONSE_CONSTITUENTID". The conflict occurred in database "[Name]", table "dbo.USR_LUMINATE_APPSURVEYRESPONSE", column 'CONSTITUENTID'". 
To resolve this issue, use the script below to transfer the Luminate Online Survey Results from one constituent to the other then attempt the merge again. Just change the Constituent lookup ids used for the source and target constituents.

DECLARE @SOURCECONSTITUENTID uniqueidentifier;
DECLARE @TARGETCONSTITUENTID uniqueidentifier;

select @SOURCECONSTITUENTID = ID
from dbo.CONSTITUENT
where lookupid = '8-12345678'; --insert source constituent lookupid

select @TARGETCONSTITUENTID = ID
from dbo.CONSTITUENT
where lookupid = '8-87654321'; --insert target constituent lookupid

UPDATE USR_LUMINATE_APPSURVEYRESPONSE
SET CONSTITUENTID = @TARGETCONSTITUENTID
WHERE CONSTITUENTID = @SOURCECONSTITUENTID;

Steps to Duplicate

1) Go to Constituents > Duplicates > Merge two constituents
2) Fill out the form > Click merge
3) Notice you encounter the error, "Data could not be saved. The DELETE statement conflicted with the REFERENCE constraint "FK_USR_LUMINATE_APPSURVEYRESPONSE_CONSTITUENTID". The conflict occurred in database "[Name]", table "dbo.USR_LUMINATE_APPSURVEYRESPONSE", column 'CONSTITUENTID'"

Was this article helpful?