select VN.FolderName, dbo.ve_GetShortPathFromContentID(T1.ContentID) Path, T1.ContentID
from vefn_GetVersionNames() VN
Join vefn_GetVersionItems('') VI ON VI.VersionID = VN.VersionID
Join
(
select CC.CONTENTID 
from Contents CC 
Join Parts PP ON CC.ContentID = PP.ContentID
Join Items IP ON IP.PreviousID = pp.ItemID
where type = 20042
) T1 ON T1.ContentId = VI.Contentid