I am wacking my 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?