I am wacking y head over the problem with this code.
DECLARE @root hierarchyid
declare @lastchild hierarchyid
SELECT @root = NodeHierarchyID from NodeHierarchy where ID = 1
set @lastchild = getlastchild(@root)
it says it does not recognize getlastchild function. What am I doing wrong here