It's make me to laugh sometime when i look at SharePoint the way programmed.
My scenario really sucks, We have a huge 1.3 Tera (single) content database, and we thought we need reduce the size the share point be faster,
We planned to create a custom to archive old content/documents to the separate record center and it's archived, here comes the truth the record center sucked more than 400 Gigs of data, When we look into the old SharePoint portal (assuming content db would have reduced) - turned nope it's not
It is same as it was earlier. Now dying with storage.
What is the cleaner way to delete a document or any other content from a library.
My Question is, if you program it to delete a file as SharePoint way
SPFile.Delete();
It ideally calls the internal delete function to delete from the database.
But i found out one more interesting stuff,
SharePoint maintains everything in database - just digg around, i found the entry for the specific file resides in a so called table name : dbo.AllDocs
try to filter with DirName column - SPFolder.Url
in SharePoint
LeafName column - SPFile.Name
in SharePoint
SELECT *
FROM [<DatabaseName>].[dbo].[AllDocs]
WHERE DirName LIKE '<Your Folder URL>'
after lots of hours past
i found a microsoft technet suggested to use http://technet.microsoft.com/en-us/library/dd789569.aspx Job-gradual-site-deletion: STSADM property, and it says applies to SharePoint Server 2007.
actually if you run STSADM -HELP SETPROPERTY/GETPROPERTY
in 12 Hive of SharePoint Server
THERE IS NO SUCH PROPERTY EXISTS IN STSADM COMMANDLET
try
STSADM -O GETPROPERTY -PROPERTYNAME JOB-GRADUAL-SITE-DELETION
returns <Property Exist="No" />