web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Payroll - violation of PRIMARY KEY constraint in temp table

(0) ShareShare
ReportReport
Posted on by

We're getting the infamous PRIMARY KEY violation error on a temp table when running the period-end payroll benefit summary report (Reports-->Payroll-->Period-End-->Benefit Summary).

 

So far I've ran check links on payroll (no errors found),  rebuilt indexes for UPR00100, UPR00600, and UPR30300 (tables being referenced in uprLoadTempXCmpyBenefitSummary), and rebooted the server.  I've also peeked in the UPR tables above looking for a possible duplicate but did not find anything obvious, corrupt, or blank.

I was able to run sp_help and sp_helpconstraint on the temp table so I know what the PK is.  I just can't figure out the duplicate or corrupt record(s).  How can I get the complete GP error that is being cut off in the msg box to get the duplicate key value violation?

Many thanks.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Payroll - violation of PRIMARY KEY constraint in temp table

    Hi Sanjay, thanks for your help but clearing the temp tables did not resolve the issue.  Any other suggestions?

  • Community Member Profile Picture
    on at
    RE: Payroll - violation of PRIMARY KEY constraint in temp table

    Get all  users off the GP clear your temp files  and check if that helps...

    DELETE DYNAMICS..ACTIVITY

    DELETE DYNAMICS..SY00800

    DELETE DYNAMICS..SY00801

    DELETE TEMPDB..DEX_LOCK

    DELETE TEMPDB..DEX_SESSION

    Cheers!

    Sanjay

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
babubaskaran@outlook.com Profile Picture

babubaskaran@outloo... 2

#1
Yng Lih Profile Picture

Yng Lih 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans