Error messages similar to the following occur in the SASCustIntelCore6.x.log file, which is located at [Config]\Lev1\Web\Logs\SASServer6_1\SASCustIntelCore6.6.log:
ERROR: During insert: Violation of PRIMARY KEY constraint
and
Cannot insert duplicate key in object
These errors indicate that you very likely have duplicate entries for the Surrogate Key (SK) number in the sequence table located at [Config]/Lev1/Applications/SASCustomerIntelligence/CustomerIntelligenceCommon
/Data/MAMisc. (For example, SkCellPackage or SkCommunication.)
Here is an example of a sequence table with duplicate entries:
The sequence table is used to get the next available SK numbers for insertion into the Common Data Model (CDM) tables. For example, CELL_PACKAGE_SK, COMMUNICATION_SK, CAMPAIGN_SK, and so on. As a result, the table should not contain any duplicate entries.
Note that the sequence table needs to have Read and Write permissions, so duplicate entries mostly occur when the table was not available for writing (sometimes in the past).
To circumvent this issue, you need to delete the duplicate entry—preferably entries with the lower value for the SK number—and increase the number of the higher entry.
libname abc
'C:\SAS\Config\Lev1\Applications\SASCustomerIntelligence\
CustomerIntelligenceCommon\Data\MAMisc';
proc sql;
update abc.sequence
set number = 667783 → add approximately 20 more to the highest value that you saw in step one
where sequence = "SkCellPackage";
quit;
To verify that the expected value is displayed, run the following code:
proc contents data=abc.sequence; run;
proc print data=abc.sequence; run;
%macro maspinit(xmlstream=);
%global maDebug MAError MAMsg MANodeName MATableName MAColumnName MATables;
%if &maDebug eq Y
%then %do;
option mprint source source2 stimer notes symbolgen;
%end;