PK violations are not related to security in any way. You must have a logic or data issue.
User Account receives primary key violation but not another user
Hi
We're trying to set up a proxy user to run an SQL Server job, but there are steps in the SSIS package with are MERGE statements.
The user account set up, which has sysadmin rights against the databases, receives a 'Violation of PRIMARY KEY constraint' error when doing this statement. Another user, with the exact same security permissions, does not get this violation, and not does the SQL Server Agent.
When separating the statement out to its separate parts, inserting in TEMPDB, and then doing a MERGE, no such violation occurs.
I have been unable to find any reference to this problem, and any assistance would be greatly appreciated. We're using SQL Server 2016.
Thanks.
2 answers
Sort by: Newest
-
-
Monalv-MSFT 5,896 Reputation points
2020-08-28T09:06:55.873+00:00 Hi Mia,
May I know if you insert the duplicated value into the table with Primary Key?
Hope the following links will be helpful:
[Dealing with Violation of PRIMARY KEY constraint SSIS closed
Best Regards,
Mona
If the response is helpful, please click "Accept Answer" and upvote it.