Guess even MS misses typos.

  • I was playing with a Functon when I did something I wasn't suppossed to and this was my response.

    Server: Msg 443, Level 16, State 2, Procedure fn_fix_case, Line 25

    Invalid use of 'RAISEERROR' within a function.

    Can anyone else see what is wrong?

  • RAISEERROR ?  Shouldn't this be RAISERROR??



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • What is the E-Mail address for it? sqlwish@microsoft.com ?

    I wish there were only such mistakes in SQL Server

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Nope this is the response SQL Server gave me when I tried to use the RAISERROR method in the code of a UDF.

  • Sorry, I meant there are more severe and not so funny errors than this additional E.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Oh, and while we're at it. Shouldn't

    Functon

    read

    Function

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • No, I was writing Functons in 2000 thank you. HEHE.

  • http://www.microsoft.com/typography/ctfonts/WordRecognition.aspx

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Antares686.. on a more serious note, it is forbidden to use raiserror in a UDF. I however found a nice workaround :

    CREATE FUNCTION [dbo].[fnTest] ()

    RETURNS int AS

    BEGIN

    --do your stuff

    Declare @Error as varchar(100)

    --errhandler

    if 1=1

    begin

    --raise the error here--+ 1 cause sqlserver to raise the error because of an invalid cast

    set @Error = 'Err raised from fnTest... err message' + 1

    end

    return 0

    END

  • Interesting. I also knew about the RAISERROR thing I was just typing and wasn't thinking about it. Just thought was funny MS had a typo.

     

    And BTW, if you look message 443 is defined in the sysmessages table as

    Invalid use of '%s' within a function.

  • I think it's surprising they don't have a lot more... think about how many GB of text they published over the years... if only their software had so few bugs :-).

Viewing 11 posts - 1 through 10 (of 10 total)

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