PK violation in resource demand job / step Update RD_NonWorkingDaysTable v2014
Symptoms
Sometime the step 'Update RD_NonWorkingDaysTable' of the resource demand job fails with a PK error. Running it manually again works fine.
Error/warning messages:
Msg 2627, Level 14, State 1, procedure GetResourceNonWorkingDays
Viloation of PRIMARY KEY constraint 'PK_RD_NonWorkingDays'. Cannot insert duplicate key in object 'dbo.RB_NonWorkingDays'.
Resolution
This might happen if this job or a similar job runs in parallel at the same time.
Please make sure that
- there is no second definition of this job (e.g. for a different environment) that by mistake still points to the same environment
- there is no custom interface (like import of holidays or vacation time) that is related to non-working days that runs at the same time