Try this query:
;
with Q as
(
select *, 0 as c
from #temp1
union all
select *, 1 as c
from #temp2
)
select row_number() over (order by ID, c) as SlNo, ID, case c when 0 then 0 else ID end as ParentID, Name, Comment
from Q
order by ID, c
It assumes that #temp1 contains parents and #temp2 contains children.