How to call a scalar function in a stored procedure

后端 未结 4 959
逝去的感伤
逝去的感伤 2021-01-01 10:48

I am wacking my head over the problem with this code.

DECLARE @root hierarchyid
DECLARE @lastchild hierarchyid
SELECT @root = NodeHierarchyID FROM NodeHierar         


        
4条回答
  •  既然无缘
    2021-01-01 11:38

    Use

    set @lastchild = dbo.getlastchild(@root)
    

    From CREATE FUNCTION

    Scalar-valued functions may be invoked where scalar expressions are used, including computed columns and CHECK constraint definitions. When invoking scalar-valued functions, at minimum use the two-part name of the function.

提交回复
热议问题