none
Don't show my Function

    Question

  • Hi,

    I want create on function in sql with :

    CREATE FUNCTION [dbo].[TESTT] ()
    RETURNS BIGINT
    AS
    BEGIN
        DECLARE @temp BIGINT
        select @temp =
            SUM (users_id)
            from users
            RETURN @temp;
            END

    I can create function and see it in scalar-function

    But when i used the function, don't show it. with following command.

    TESTT don't exist in list!

    select dbo.

    Saturday, April 20, 2013 3:27 PM

Answers

  • to run the function use -- select dbo.testt()

    make sure, your function was created in the same database..

    run this to see if the function was actually created 

    select * from sys.objects where name = 'testt' and type='fn'

    Also, it looks like you actual query has more to it, may be there is some syntax wrong in there..please post the actual syntax and that can help better..


    Hope it Helps!!


    • Edited by Stan210 Saturday, April 20, 2013 3:37 PM
    • Marked as answer by Arash_89 Saturday, April 20, 2013 3:45 PM
    Saturday, April 20, 2013 3:36 PM