This question was already answered in your previous post. Is there a problem with the solution given?
SELECT
ROW_NUMBER() OVER (ORDER BY ID, ParentId) as SINo,
ParentId,[Name],[Comment]
FROM (
select 0 as ParentId, [Name], [Comment], ID
from #temp1
UNION ALL
select ID as ParentId, [Name], [Comment], ID
from #temp2
) a
ORDER BY 1