Delete property content of all children of given node via SQL query
Hi,
Given a node with ID "X", how can we delete the values/content of a property with alias "Y" of all the children (and their children) pages of node "X", via an SQL Server query?
So that only the content of the properties will be empty, not deleting the property itself, just their values.
The property we need to empty is a nested content type, all its items need to be removed.
update upd
set varcharValue = null, textValue = null
from umbracoPropertyData upd
join umbracoContentVersion cv on cv.id = upd.versionId
join umbracoNode un on un.id = cv.nodeId
join cmsPropertyType pt on pt.id = upd.propertyTypeId
where un.nodeObjectType like 'C66BA18E-EAF3-4CFF-8A22-41B16D66A972' and Alias like 'title' and (cv.nodeId = 1053 or un.[path] like '%1053,%')
Just replace the 'title' with Y, and replace the 1053 with the X
Delete property content of all children of given node via SQL query
Hi,
Given a node with ID "X", how can we delete the values/content of a property with alias "Y" of all the children (and their children) pages of node "X", via an SQL Server query?
So that only the content of the properties will be empty, not deleting the property itself, just their values.
The property we need to empty is a nested content type, all its items need to be removed.
Thanks!
Hey,
You can use something like this:
Just replace the 'title' with Y, and replace the 1053 with the X
-Joep
is working on a reply...