SQL Server: Cannot execute existing scalar function from within table-valued function : <p>I created this scalar function, without any problems.<br>
But I can't execute it from another function (inline table-valued).</p>

<pre><code>USE [test]
GO

/****** Object:  UserDefinedFunction [dbo].[NameFromEnumerationID]    Script Date: 10/9/2018 6:46:22 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE FUNCTION [dbo].[NameFromEnumerationID]
(
    @EnumerationIDParam INT NOT NULL
)
RETURNS NVARCHAR ( 48 )
WITH    NATIVE_COMPILATION ,
        SCHEMABINDING
AS BEGIN ATOMIC WITH (  TRANSACTION ISOLATION LEVEL = SNAPSHOT      ,
                        LANGUAGE                    = N'English'    )
    RETURN CHOOSE ( @EnumerationIDParam                         ,
                    CAST ( N'ExampleName1' AS NVARCHAR ( 48 ) ) ,
                    CAST ( N'ExampleName2' AS NVARCHAR ( 48 ) ) ,
                    CAST ( N'ExampleName3' AS NVARCHAR ( 48 ) ) ,
                    CAST ( N'ExampleName4' AS NVARCHAR ( 48 ) ) ,
                    CAST ( N'ExampleName5' AS NVARCHAR ( 48 ) ) ,
                    CAST ( N'ExampleName6' AS NVARCHAR ( 48 ) ) ) ;
END
GO
</code></pre>

<p>When I try to create another function that executes the above function, I receive the error:<br>
<code>'NameFromEnumerationID' is not a recognized built-in function name.</code></p>

<pre><code>CREATE FUNCTION [dbo].[NamesFromEnumerationIDs]
(
    @EnumerationIDListParam [IntList] NOT NULL READONLY
)
RETURNS TABLE AS RETURN
(
    SELECT  [Value]                                 AS [ID]                     ,
/* ERROR */ NameFromEnumerationID   ( [Value] )     AS [EnumerationName]        ,
    UPPER ( [NameFromEnumerationID] ( [Value] ) )   AS [EnumerationNameUpper]   ,
            [IsEnumerationIDValid]  ( [Value] )     AS [IsValid]
        FROM @EnumerationIDListParam
)
GO
</code></pre>

<p>For the parameter to the second function, the <code>IntList</code> type is very simple:</p>

<pre><code>USE [test]
GO

/****** Object:  UserDefinedTableType [dbo].[IntList]    Script Date: 10/9/2018 6:55:56 AM ******/
CREATE TYPE [dbo].[IntList] AS TABLE(
    [Value] [int] NOT NULL
)
GO
</code></pre>

<p>How do I execute the first function as part of the query in the second function?</p>
