Can I safely remove Entries in dbo.EventReceivers ?

The Problem is that when i'm deploying a Solution i get on the Feature Activation many Errors in the SharePoint Logs like:

System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'EventReceivers_PK'. Cannot insert duplicate key in object 'dbo.EventReceivers'. The statement has been terminated.

But the EventReceiver i'm trying to Install is not installed before. When i'm looking in with Powershell there are no Registered EventReceivers on the List and even the List is before the deploying deleted.

I can only assume that SharePoint somehow hanged himself up at a earlier point and did not removed safely the EventReceivers from the Database.

Soo must I pay attention to anything else or can I simply remove the entries in the Database ?


It is not supported in any way to do changes in the SharePoint DB.

That being said, you seriously just have to try your luck. If there are really no attached event receivers to be found via PowerShell there also shouldn't any database references. Make a backup of the database beforehand and then try deleting the respective rows, but again: This is unsupported and might break stuff.

  • 1
    I tried my luck and it worked ;) SharePoint seems also not be broken ;) Thx I thought that it is not a recommend way, but the DB references where there although the EventReceivers not... Don't know how that happened, but now it's fixed :) – Mark Apr 12 '13 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.