Error - is not a recognized function name

  • Hi,

    I created this function, but when I tried to use it in a stored procedure, it says the function is not a recognized function. I created a dummy function to test whats wrong. It throws the same error. This is the dummy test function.

    CREATE FUNCTION [dbo].[fn_test] (@xyz INT)

    RETURNS INT

    AS

    BEGIN

    RETURN @xyz

    END

    This is how I tried to use it SELECT @i = fn_test(10). This is the error message Error 195 'fn_test' is not a recognized function name. Can any one tell me what am I doing wrong.

    Thanks.

  • You have to preface the function in the select with dbo.  An example is:

    SELECT @i = dbo.fn_test(10)

     

  • Thanks.

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

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