UDF Problem

  • Hello,

    I am trying to create the following function

    CREATE FUNCTION ufn_space()

    RETURNS @Results TABLE (Drive CHAR(1),DBFree INT)

    AS

    BEGIN

     INSERT INTO @Results EXEC master.dbo.xp_fixeddrives

     RETURN

    END

    GO

    getting the error

    Server: Msg 197, Level 15, State 1, Procedure fn_fixeddrives, Line 13

    EXECUTE cannot be used as a source when inserting into a table variable.

    Is there any way to store the results in table return the table (not through the stored procedure)

     

  • For the given scenario the answer is no.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply