You have 3 options.
What you are using is a recursive data structure. It will require that you use recursion or iteration to find the root node. You will need a
while loop that repeatedly performs a SELECT statement on the previous node to find it's "child" (in recursive terminology, this would usually be called the "parent", as a child can have one parent but one parent may have many children).
An alternative would be to use a "
common table expression" to create a recursive query, though this feature is only available in SQL Server 2008. You can read more about that technique
here.
Finally, you can also create a
recursive function that basically does what the while loop does, but in a recursive fashion. Note, however, that some versions of SQL Server have limitations on the allowable depth of recursion, though I'm not sure if that is restricted to just stored procedures (you can create a function instead of a stored procedure).