Deleting waste basket piece by piece


After a big clean up we now have 78000 pages in our waste basket. I wan't to delete these pages and have tried the stored procedure [sp_DeleteOldPages] but after 39 minutes I get a deadlock.

I would like to delete the pages piece by piece to make the queries quicker. It feels like the [sp_DeleteOldPages] procedure can take very very long time.

Any ideas?

Nov 04, 2009 7:40

Now I tried to delete one page with stored procedure editdeletePage with the following code, but all I get is returnvalue=0. the page is not deleted. Why isn't it deleted?


DECLARE @return_value int

EXEC @return_value = [dbo].[editDeletePage]
  @PageID = 320124,
  @ForceDelete = 1

SELECT 'Return Value' = @return_value

Nov 04, 2009 8:46
Nov 04, 2009 8:46

Why not use the empty recycle bin scheduled service for this? You could also take a peak at the code with reflector to see what it does.

Nov 04, 2009 16:14
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.