You are hereSharePoint v3: Deleting Items through the Database and tp_DeleteTransactionID


SharePoint v3: Deleting Items through the Database and tp_DeleteTransactionID


By hagrin - Posted on 02 June 2008

While extremely unrecommended, sometimes you just want to fix a problem quickly and without jumping through a ton of hoops using the SharePoint SDK and writing a small C# program. I recently encountered this when I needed to delete a Folder from a whole bunch of Document Libraries across hundreds of sites. Making sure that I checked to see if the folder was there first, calling the right Web, calling the right List, getting the right Folder GUID, etc. all seemed like a lot of work for a simple SQL statement so I cheated.

Folders all stored in the AllUserData table with a tp_ContentType = 'Folder'. I was able to write a simple UPDATE statement like the following to delete the unwanted folder across the sites I wanted -

UPDATE AllUserData
SET tp_DeleteTransactionID = 0x00000010
WHERE tp_ContentType = 'Folder' and ...

Quick and very dirty. Not recommended, kids don't try this at home.