in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Niklas Östh's Sharepoint Blog

SharePoint tips and tricks from Sweden.

January 2008 - Posts

  • 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 ...

  • SPUrl and ~Language

    If you are using the SPUrl expression prefix you can use the ~language to get the language-code for the site.

    Example:
        <link id="LanguageCss" rel="stylesheet" type="text/css" href="<% $SPUrl:~SiteCollection/Style Library/TheCompany/~language/LanguageSpecificStyle.css%>" runat="server" />
    Will give you something like this when evaluated:
        <link id="ctl00_LanguageCss" rel="stylesheet" type="text/css" href="/sites/theSite/Style Library/TheCompany/en-US/Styles/LanguageSpecificStyle-main.css" />

    Posted Jan 07 2008, 10:27 AM by niklaso with 3 comment(s)
    Filed under:

Need SharePoint Training? Attend a SharePoint Bootcamp!

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