user-defined function

  • I have created a function with name 'fun_tica_getcompcode'.It is created sucecessfully.

    but when i try to invoke by givng:

    select fun_tica_getcompcode('TI')

    i got the following error:

    'fun_tica_getcompcode' is not a recognized function name.

    Please suggest ,is anyone has knowledge about this.

  • You have to use the 2 part name Owner.Function

    For instance if I create a function name fn_CalcFirstDay and don't change the owner from dbo then I use like so

    SELECT dbo.fn_CalcFirstDay(HireDate) FROM tblEmployees

    See "User-Defined Functions" in BOL for more details.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • quote:


    You have to use the 2 part name Owner.Function

    For instance if I create a function name fn_CalcFirstDay and don't change the owner from dbo then I use like so

    SELECT dbo.fn_CalcFirstDay(HireDate) FROM tblEmployees

    See "User-Defined Functions" in BOL for more details.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)


  • Hi,

    I have tried it and it ran successfully.Thank so much for your time

    regards,

    srivalli.

    quote:


    You have to use the 2 part name Owner.Function

    For instance if I create a function name fn_CalcFirstDay and don't change the owner from dbo then I use like so

    SELECT dbo.fn_CalcFirstDay(HireDate) FROM tblEmployees

    See "User-Defined Functions" in BOL for more details.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)


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

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