How to call a scalar function in a stored procedure

后端 未结 4 960
逝去的感伤
逝去的感伤 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:28

    try including the schema id, as in

    @lastchild = dbo.getlastchild(@root)
    
    0 讨论(0)
  • 2021-01-01 11:33

    Try:

    SELECT * FROM dbo.function(@parameters) 
    
    0 讨论(0)
  • 2021-01-01 11:34

    Try

    set @lastchild = dbo.getlastchild(@root)
    
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题