select CTT.*, TT.* From (select ContentID FromID, TransitionID, TranType, ToID, RangeID, DTS from Contents cc
cross apply vefn_FindTransitions(cc.Text) 
where cc.Text like '%Link:Transition%') CTT
JOIN VEFN_GetVersionProcedureItems('') VI ON VI.ContentID = CTT.FromID
JOIN VEFN_GetVersionNames() VN ON VI.VersionID = VN.VersionID
left Join Transitions TT on TT.TransitionID = case when CTT.TransitionID like '<%' then 0 else cast(CTT.TransitionID as int) end
Where TT.TransitionID is not null and TT.FromID != CTT.FromID or TT.ToID != CTT.ToID