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.

Hi,

I tried to restore a list item, that didn't show up in the recycle bin.
I SQL command looked like this:

UPDATE dbo.AllUserData
SET tp_DeleteTransactionID = 0x
WHERE tp_GUID=C0D7925A-A87E-4579-8C02-95C7F9942D93

But it still doesn't show up in the browser.
Do you know, if there are any other things to be done, to restore an item??
I could take it from the backup - but since it is a single list item, it would be a big job, for a small thing...

Recent comments