SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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