SourceCode/PROMS/SQL Data Tools/FindUneditableStepText.sql
2023-05-09 18:21:47 +00:00

14 lines
591 B
SQL

select XX.*, CC.Text from (
select ItemID from Parts
where FromType = 6 and ContentID IN(select pp.contentid
--,xSubSection.value('@Edit','varchar(1)') Editable
from parts pp
join (select Contentid, cast(config as xml) xConfig from contents) CC ON CC.ContentID= pp.ContentID
outer apply xConfig.nodes('//SubSection') tSubSection(xSubSection)
where fromtype in (2,6)
and isnull(xSubSection.value('@Edit','varchar(1)'),'N')='N'
group by pp.contentid
having count(*) > 1) ) ah
Cross Apply vefn_SiblingItems(ah.ItemID,null) XX
Join Contents CC ON CC.ContentID=XX.ContentID
order by xx.ItemID