As a select query, you can use a correlated subquery for this:
select id,
(select top 1 name
from yourtable t2
where t2.id <= t.id and
t2.name is not null
order by t2.id desc
) as name
from yourtable t;