There may be better ways, but these seams do the job.
declare @T table ( ID int, Name varchar(10), HID HierarchyID ) insert into @T values (1, 'Craig', '/'), (2, 'Steve', '/1/'), (3, 'John', '/1/1/'), (4, 'Sam', '/2/'), (5, 'Matt', '/2/1/'), (6, 'Chris', '/2/1/1/') select * from @T where HID.GetDescendant(null, null) not in (select HID from @T)
Result:
ID Name HID ----------- ---------- --------------------- 3 John 0x5AC0 6 Chris 0x6AD6
Update 2012-05-22
The query above will not work if the node numbers are not in a continuous sequence. Here is another version that should take care of this.
declare @T table ( ID int, Name varchar(10), HID HierarchyID ) insert into @T values (1, 'Craig', '/'), (2, 'Steve', '/1/'), (3, 'John', '/1/1/'), (4, 'Sam', '/2/'), (5, 'Matt', '/2/1/'), (6, 'Chris', '/2/1/2/') -- HID for this row is changed compared to above query select * from @T where HID not in (select HID.GetAncestor(1) from @T where HID.GetAncestor(1) is not null)