Вы хотите использовать рекурсивный CTE.
Следующие получают все пути:
with cte as (
select cast(child as varchar(max)) as path, child, 1 as lev
from t
where parent is null
union all
select cast(cte.path + ' - ' + t.child as varchar(max)), t.child, lev + 1
from cte join
t
on cte.child = t.parent
)
select *
from cte;
Если вы просто хотите, чтобы пути к конечным листьям:
select *
from cte
where not exists (select 1
from t
where t.parent = cte.child
);