Violation of PRIMARY KEY constraint 'PK_sysnotificationuser'.cannot insert duplicate key in object
****** Internal to CitiXsys******
Environment:
6.6 Patch 7608
Problem Statement:
Getting error while restoring the backup file at a new store.
Symptom:
Below is the error message:
'violation of PRIMARY KEY constraint 'PK_sysnotificationuser'.cannot insert duplicate key in object dbo.SysnotificationUser'
Cause:
Seems huge data in table SysnotificationUser causing the issue.
Solution:
1) We ran SQL queries and excluded tables "SysNotification, SysNotificationUser" at HO Database so that these tables are not included in backup at HO.
2) Then took a fresh backup from Enterprise MC which got restored at Store successfully.
3) Below are the queries used to exclude the tables taken from backup:
Select * from RepObjectMapDB where TableName like '%notification%' and ObjectID in (370, 371)
--Update RepObjectMapDB set ExcludeInStoreBackup = 1 where TableName like '%notification%' and ObjectID in (370, 371)