in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Niklas Östh's Sharepoint Blog

SharePoint tips and tricks from Sweden.

WSS Incremental Deployment Job and Violation of Primary Key Constraint Error

After SP1 the problem with Violation of Primary Key Constraint Error returned when we tried to run the incremental job. The previous Hot fix (936867) from Microsoft for this seems to have been overwritten by the SP.

We got this error:
Content deployment job 'Incremental Content Deployment' failed.The exception thrown was 'System.Data.SqlClient.SqlException' : 'Violation of PRIMARY KEY constraint 'PK__#ExportObjects____4F86F15A'. Cannot insert duplicate key in object 'dbo.#ExportObjects'. The statement has been terminated.' 

To solve this we turned off minor versions on both the Style Library and the Site Collection Images library.

But it still did now work so I removed all previous versions of the files that had a version above 1.0 and that did the trick. (I created a flat view that only displayed the items with version greater than 1.0).

Thanks to the Hungarian SharePoint Geek that pointed me in the correct direction:
http://www.sharepointblogs.com/pholpar/archive/2007/05/22/primary-key-violation-when-using-the-spexport-object.aspx

Updated: The problem came back so I created a feature with a reciever that turned off the Parallell Worklow, Approval, Versioning and in and out checking of the libraries Images and Documents. Then a made sure that this feature was turned on in all my site templates and then I used a small console application to turn it on on all sites that were created earlier. That made the trick ...

Comments

 

jabahooie said:

I have the same exact problem.  So you turn off these features prior to depoloyment and then turn them back on afterwards?  Any chance you could send me the feature you created as well how to use it?

February 28, 2008 10:24 PM
 

Henk Hooiveld said:

Just like you and jabahooie, I encounter the same problem. Are you willing to make your solution available to the public? I believe it makes quite a few people happy.

I'm certainly interested in receiving your solution.

March 7, 2008 10:22 AM
 

Anders said:

There is a post SP1 hotfix available from MS. The  name is wss-kb950279-fullfile-x86-glb.exe.

It solved the problem at a client of mine.

/Anders P, SIGMA

April 4, 2008 6:23 AM
 

niklaso said:

Yes, and it works also I have heard. We have not installed it on out production machine yet because we now use spexport and spimport to content deploy.

April 5, 2008 1:51 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

About niklaso

Developer at Qurius Sweden

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts