Using umbraco 7.34, tried to empty recycle bin, failed, and got this error :
System.Data.SqlClient.SqlException: The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "FK_umbracoNode_umbracoNode_id". The conflict occurred in database "DB_xxxxxx_xxxx", table "dbo.umbracoNode", column 'parentID'.
The statement has been terminated.
It seems to have been fixed on 7.5.3 which flushed the Media Bin with no complaints
However, if upgrading is not an option and you need that Media bin emptied ASAP, this SQL sequence still works at clearing the lot:
delete from cmsPreviewXml where nodeId in (select id from umbracoNode where path like '%-21%' and id!=-21)
delete from cmsContentVersion where contentId in (select id from umbracoNode where path like '%-21%' and id!=-21)
delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-21%' and id!=-21)
delete from cmsContentXML where nodeId in (select id from umbracoNode where path like '%-21%' and id!=-21)
delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-21%' and id!=-21)
delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-21%' and id!=-21)
delete from dbo.umbracoUser2NodePermission where nodeId in (select id from umbracoNode where path like '%-21%' and id!=-21)
delete from dbo.umbracoRelation where parentId in (select id from umbracoNode where path like '%-21%' and id!=-21)
or childId in (select id from umbracoNode where path like '%-21%' and id!=-21)
-- delete the XML nodes....
ALTER TABLE umbracoNode NOCHECK CONSTRAINT FK_umbracoNode_umbracoNode
delete umbracoNode where id in (select id from umbracoNode where path like '%-21%' and id!=-21)
ALTER TABLE umbracoNode CHECK CONSTRAINT FK_umbracoNode_umbracoNode
delete from umbracoNode where path like '%-21%' and id!=-21
Media recycle bin can't be emptied
Using umbraco 7.34, tried to empty recycle bin, failed, and got this error :
I am not sure if this is related to another problem : Upload files to media fail with error
Hi Bruno
I'm getting something similar on 7.4.2 but I think is more related to this issue http://issues.umbraco.org/issue/U4-8239
It seems to have been fixed on 7.5.3 which flushed the Media Bin with no complaints
However, if upgrading is not an option and you need that Media bin emptied ASAP, this SQL sequence still works at clearing the lot:
is working on a reply...