Have you tried using the two hierarchy based table value functions: INV_TRAVERSE_TO_BOTTOM_FCT and INV_TRAVERSE_TO_TOP_FCT ( I think I've posted threads about them here before).
These loop through the structure, either up from the bottom or down from the top, based on a parent or child parameter and break out the records showing the parent/child relationship and level of the hierarchy.
You can then do something like this - which will give you all records beneath a parent:
declare @parent_id as integer
select
parent.unique_name as parent_code,
parent.name as parent,
child.unique_name as child_code,
child.name as child,
hier.lvl as hierarchy_level
from
srm_projects parent inner join
niku.inv_traverse_to_bottom_fct(@parent_id) hier on hier.parent_id = parent.id inner join
srm_projects child on child.id = hier.child_id
Owen