This project is read-only.

Project Description

SharePoint Discussion Board Orphaned Attachments Analyzer is a WinForm 2.0 application that helps SharePoint Administrators and/or developers to find and remove (optional) orphaned attachments in SharePoint Discussion Board. See Home page for more details.

EDIT 12/02/2009 : The October CU seems to fix the problem treated by this application.

As I don't have tested this patch right now, I can't say if it removes all existing orphaned attachments or if it only fix SharePoint for next deletion.
More information : (3rd bullet point)

Disclaimer - You must read this before use

The code used in this application is not supported by Microsoft as it uses SQL Command to remove objects in SharePoint databases !

Use it at your own risk !

Really i'm not kidding, don't send me e-mail if everything is broken ;) and remember to make Backup before use !

What is the purpose of this application

When you delete a Discussion Board Item (using SharePoint object model or UI) if the item has attachments, those are not deleted. They became orphans and cannot be managed by UI or code anymore. The only way I found to manage (ie delete) these orphaned attachments is to deal directly in the SharePoint databases. These orphans don't seems to be a problem until you try to export a WebSite using the "stsadm -o export" command or the Content Migration API, then you could get this message :

FatalError: This constraint cannot be enabled as not all values have corresponding parent values.
at System.Data.ConstraintCollection.Add(Constraint constraint, Boolean addUniqueWhenAddingForeign)
at System.Data.DataRelationCollection.DataSetRelationCollection.AddCore(DataRelation relation)
at System.Data.DataRelationCollection.Add(DataRelation relation)
at System.Data.DataRelationCollection.Add(String name, DataColumn[] parentColumns, DataColumn[] childColumns)
at Microsoft.SharePoint.Deployment.ListItemObjectHelper.GetNextBatch()
at Microsoft.SharePoint.Deployment.ObjectHelper.RetrieveDataFromDatabase(ExportObject exportObject)
at Microsoft.SharePoint.Deployment.ListItemObjectHelper.RetrieveData(ExportObject exportObject)
at Microsoft.SharePoint.Deployment.ExportObjectManager.GetObjectData(ExportObject exportObject)
at Microsoft.SharePoint.Deployment.ExportObjectManager.MoveNext()
at Microsoft.SharePoint.Deployment.ExportObjectManager.ExportObjectEnumerator.MoveNext()
at Microsoft.SharePoint.Deployment.SPExport.SerializeObjects()
at Microsoft.SharePoint.Deployment.SPExport.Run()

using the tool provided by this project, you can verify if there are orphaned attachments in the SharePoint WebSite Discussion Board (in fact it tests all Lists in the WebSite, but orphans should only appears in Discussion Board), and choose if you want to remove them or not.

This application is published with the courtesy of Alti

Hope it can help !

Last edited Dec 2, 2009 at 7:11 PM by EdgarMaucourant, version 7