SQL Server поддерживает рекурсивные CTE, поэтому вы можете сделать:
with t as (
select v.*
from (values ('A', 'C', 2), ('C', 'F', 3), ('A', 'B', 1)) v(bom, component, quantity)
),
cte as (
select bom as source, bom, component, quantity
from t
union all
select cte.source, t.bom, t.component, cte.quantity * t.quantity
from cte join
t
on cte.component = t.bom
)
select *
from cte;
Здесь - это скрипта db <>.