If you want to delete data from SharePoint database and regain valuable space, please try following SQL commands. Basic idea is that AllDocs, AllDocStreams, and AllDocVersions tables of the SharePoint content database contains heavy duty data. There is a column in each of these tables named DeleteTransactionId. This column stores a hexadecimal value. Almost always, the default is 0x (zero-x).
If the value of this column contains anything else than the 0x, this means that the row has been marked for deletion. Technically, any of these rows are no longer needed and are currently not active within the MOSS/SharePoint environment.
So technically, these rows can be removed, space can be regained, and nobody will notice the difference on the web-front-end.
Please note that this code is a way to remove items that have been deleted from SharePoint but not deleted from the underlying database. It is a non-conventional method that would probably not be recommended by Microsoft and could violate support agreements. Only the person running this code is responsible for the results. It is always recommended that any data is backed-up before deletion.
USE [WSS_CONTENT] --- content database name here
go
DELETE FROM dbo.AllDocs WHERE DeleteTransactionID <> 0x
go
DELETE FROM dbo.AllDocStreams WHERE DeleteTransactionID <> 0x
go
DELETE FROM dbo.AllDocVersions WHERE DeleteTransactionID <> 0x
go
cf6e18ac-b88c-45e3-be64-2c774f43e289|1|5.0