You either need to remove the item from the database. Or create the doc type and then you will be able to delete the node. You might be able to do it thought the API
You could use this SQL to do the job.
BEGIN TRAN
02
03
DECLARE @Nodes TABLE (NodeId int)
04
05
INSERT INTO @Nodes (NodeId)
06
SELECT top 1000 n.id
07
FROM cmsContent C
08
INNER JOIN cmsContentType CT ON C.contentType = CT.nodeId
09
INNER JOIN umbracoNode N ON C.nodeId = N.id
10
WHERE CT.alias = '[Your Document Type Alias Here]'
11
12
select id, [text] from umbracoNode where id in (select NodeId from @Nodes)
13
14
delete from cmsPreviewXml where nodeId in (select NodeId from @Nodes)
15
delete from cmsContentVersion where contentId in (select NodeId from @Nodes)
16
delete from cmsDocument where nodeId in (select NodeId from @Nodes)
17
delete from cmsContentXML where nodeId in (select NodeId from @Nodes)
18
delete from cmsContent where nodeId in (select NodeId from @Nodes)
19
delete from cmsPropertyData where contentNodeId in (select NodeId from @Nodes)
20
delete from umbracoRelation where parentId in (select NodeId from @Nodes) OR childId in (select NodeId from @Nodes)
21
delete from cmsTagRelationship where nodeId in (select NodeId from @Nodes)
22
delete from umbracoNode where id in (select NodeId from @Nodes)
23
Server error: Failed to delete item 1080 (Template)
Hi guys,
Not sure if anyone encountered this before. I deleted the DocumentType before deleting its template and i ran into this error...
I have no idea how i can run a query to delete it from the database, i am using SQL CE.
Any kind souls care to help me out?
Sincerely,
Thanks!
You either need to remove the item from the database. Or create the doc type and then you will be able to delete the node. You might be able to do it thought the API
You could use this SQL to do the job.
BEGIN TRAN 02
03 DECLARE @Nodes TABLE (NodeId int) 04
05 INSERT INTO @Nodes (NodeId) 06 SELECT top 1000 n.id 07 FROM cmsContent C 08 INNER JOIN cmsContentType CT ON C.contentType = CT.nodeId 09 INNER JOIN umbracoNode N ON C.nodeId = N.id 10 WHERE CT.alias = '[Your Document Type Alias Here]' 11
12 select id, [text] from umbracoNode where id in (select NodeId from @Nodes) 13
14 delete from cmsPreviewXml where nodeId in (select NodeId from @Nodes) 15 delete from cmsContentVersion where contentId in (select NodeId from @Nodes) 16 delete from cmsDocument where nodeId in (select NodeId from @Nodes) 17 delete from cmsContentXML where nodeId in (select NodeId from @Nodes) 18 delete from cmsContent where nodeId in (select NodeId from @Nodes) 19 delete from cmsPropertyData where contentNodeId in (select NodeId from @Nodes) 20 delete from umbracoRelation where parentId in (select NodeId from @Nodes) OR childId in (select NodeId from @Nodes) 21 delete from cmsTagRelationship where nodeId in (select NodeId from @Nodes) 22 delete from umbracoNode where id in (select NodeId from @Nodes) 23
24 DELETE FROM @Nodes 25
26 ROLLBACK TRAN
charlie :)
is working on a reply...