Using same code and just one small change, you can get the path to the current sub-category from the very top.
With cte_Categories AS
(
Select categoryID, Category, ParentID
From Categories
Where categoryID = YOURID
UNION ALL
Select c.categoryID, c.Category, c.ParentID
From Categories AS c
Inner Join cte_Categories AS cv ON c.categoryID = cv.ParentID
)
Select *
From cte_Categories
I found this very helpful, hope you will too.