I came across this blog that stated that you also needed to look into previous versions of the files as well as files hidden.
Despite the fact that I have done this I cannot delete the ContentType.
I therefore looked into the SQL database in the AllUserData table in the Content database with the following SQL
SELECT *
FROM AllUserData
WHERE (tp_DirName LIKE '
AND ((tp_ContentType = '
ORDER BY tp_DirName
Then I got a list of files using the content type.
The main issue now is that I cannot figure out how to get rid of the content type from these files. Ideas very much appreciated.
I have
- Checked in documents
- Published them all - i.e. major version
- Previous versions has been deleted
- Emptied recycle bin
- Ensured the content type I wish to delete is not default content type (apart from the fact that SharePoint suggest it to be the new default when uploading documents - which is strange. Maybe this is the reason?)
So what do I do?
Even if I DELETE the files and REMOVE them from recycle bin they still appear in the SQL search. No wonder I cannot get rid of the content type!
Even if I go through all files in the Document Library and explicitly set
oFile.Item("ContentType") = <...>
I cannot DELETE the content type afterwards. Very strange.
22 comments:
Make sure there are no workflows running on an item using the Content Type you want to delete.
I'm in the same situation and found the SQL records using the query that's posted. Did you ever find a solution to this issue? I'm at the point of deleting the SQL records but I don't know if they may exist in other db tables. Any help will be greatly appreciated. Bryan Roberton (ThumperFLA@aol.com)
Hi Bryan,
You MUST delete all old versions with the old content type in order to have it released from the database. However, even in this sitaution I have not managed to get all objects released.
I tried to change the database by modifying the content class of the object - I didn't delete it (didn't dare to). Unfortunately it didn't help. So I reestablised the solution and created a new document library without the problem.
Morten
Did you ever find a solution to this? We're in the same boat and this is driving me nuts!
Nope - never got it working.
Well - export all documents. Delete the document library, import all documents again. Voila.
Thanks Morten. Not really the solution I was looking for though. :)
I had the same issue. I ran the following query to findout the items using the content type
SELECT *
FROM AllUserData
WHERE (tp_DirName LIKE '%')
AND ((tp_ContentType = '') and tp_ListId='')
ORDER BY tp_DirName
I found some items still using content type. So decided to delete these item from table.
DELETE
FROM AllUserData
WHERE (tp_DirName LIKE '%')
AND ((tp_ContentType = '') and tp_ListId='')
and guess what!!!!! It worked. I was able to delete content type.
I ran into this same problem and had to delete all the documents from the library that were using that content type... and it only took me two days to figure that out!
-s!
If you're using a content type on a workflow, then that content type will be listed in the Tasks list associated with the workflow. It must be deleted from there first, then it's able to be deleted from the site.
I ran into the same situation and found that contentapproval was enabled on the list. Some items where not approved so the unapproved items still held to the previous contenttype.
If this is for SharePoint 2010 then check your recycle bins to make sure there are no lists using the content type that have been deleted.
I came across this issue a wee while back!
You need to disassociate the content type from the list you were using it in. If its still associated to the list then it will be "in use"
I had the same issue, deleted the library and the content type was still in use. I cleared the recycle bin, end user recycle bin and site collection recycle bin and then it let me delete it
Most of the time it works - but sometimes SharePoint act strange as described here.
I simply didn't manage to get the record removed using SharePoint API - so had to remove it using SQL - WHICH IS DANGEROUS AND NOT SUPPORTED BY MICROSOFT.
This worked for me:
Use the following command to get a list of all solutions that are being deployed.
stsadm -o enumdeployments
Use the JobId GUID that comes back from this e.g. Deployment JobId="e99b7304-cfc0-419a-a3f2-18ca5193c838"
Cancel the "stuck" deployment (in "Deploying" status" with the following command
stsadm -o canceldeployment -id e99b7304-cfc0-419a-a3f2-18ca5193c838
Delete the stuck solution once and for all with
stsdm -o deletesolution -name mysolution.wsp -override
Redeploy your solution.
From
http://ddkonline.blogspot.com/2010/05/fix-for-sharepoint-2007-solution.html
How in God's name is a stuck solution even remotely relevant to removing a content type that is in use??
I ended up deleting my entire site collection, and then recreate it.
Lucky for me I was in a dev environment, and had nothing important in it.
I had a developed a feature that added a content type. My deactivate event didn't manage to delete the content type, and manually deleting throw the error "still in use", even while I never (!) even used the content type in a list or anything.
Removing the solution didn't help, it was still in use...
But that's what you learn when developing in SharePoint: it will always fail somewhere for some nonsense reason that only Microsoft knows, and before you know it you destroyed your entire environment without any plausible reason.
Thank you Microsoft for all the nonsense that we developers come across when developing in SharePoint! Without you my days would be oh so boring...
Should these same queries work on a SharePoint 2010 database? I keep getting errors that state invalid columns.
================
Msg 207, Level 16, State 1, Line 3
Invalid column name 'tp_DirName'.
Msg 207, Level 16, State 1, Line 4
Invalid column name 'tp_ContentType'.
Msg 207, Level 16, State 1, Line 5
Invalid column name 'tp_DirName'.
I encountered the same issue. I was able to finally remove the content type by not making it visible in the "Content Type Order" setting (uncheck the Visible checkbox). Once that was done, I was able to delete the unused content type.
i was able to work around this by going to the library using the content types and deleting from there then going to site contenty types gallery to delete.
You should check out the following two sites. Synopsis: Use SharePoint Manager to locate the content type then ensure you have deleted them from all the recycle bins.
1. http://nickhadlee.wordpress.com/2010/05/24/the-content-type-is-in-use-sharepoint-2010-error-redux/
2. http://brendannewell.com/musings/?p=14
Struggled in same issue as well.
Eventually this is my fix :
- Empty you own Recycle Bin
- then the Site Collection Recycle Bin http://sharepoint/_layouts/AdminRecycleBin.aspx
that's not it, now check both views:
Select a View
End user Recycle Bin items
Deleted from end user Recycle Bin
and make sure they are both Empty.
This did the trick to me and I was able to delete my Infopath Admin Signed form Content Type.
Post a Comment