The Broken UDF

  • Comments posted to this topic are about the item The Broken UDF

  • Hi Steve

     

    Just had a look at todays question and it appears the error message is missing so you can't try to pick the correct answer.

    Am I missing something?

     

    Regards

     

    Richard

  • I have this code on SQL Server 2017:CREATE FUNCTION AddOne

    (@i INT)

    RETURNS INT

    AS

    BEGIN

    DECLARE @result INT;

    SELECT @result = @i + 1;

    RETURN @result;

    END;

    GO

    SELECT AddOne(3)

    When I execute this, I get the following error: Msg 195, Level 15, State 10, Line 11 'AddOne' is not a recognized built-in function name. What is wrong?

    (From the email)

     

  • Thanks for that.

    In Chrome, I don't get the "Msg 195, Level 15, State 10, Line 11 'AddOne' is not a recognized built-in function name." bit.

     

    Regards

     

    Richard

  • That's what I get in 2019. Don't have a instance of 2017 loaded to see if it's the same.

  • Weird, the error is in the question editor, but not showing on the site. I've reformatted it to appear.

    The issue is a UDF requires a two part name.

     

Viewing 6 posts - 1 through 5 (of 5 total)

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