We have a table that has an ID and a ParentID.
I need to create a function that takes an ID and will build a heirarchy going up the tree until ParentID = 0 (top of the tree)
We might end up with 23,577,901,11,0
So we have passed 23 to the function and looped through 3 parents before stopping as "11" does not have a parent. 0 is held in ParentID to denote no parentID