[dba-SQLServer] User Defined Function error

Mark.Whittinghill at protective.com Mark.Whittinghill at protective.com
Thu Sep 8 11:48:54 CDT 2005


I am trying to make a user defined function, and no matter what I do I 
keep getting the error

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'FUNCTION'.

It is always finding an error in the CREATE FUNCTION line.  I can't even 
get dummy function to work

CREATE FUNCTION dbo.MyFunction(@MyParameter int) 
RETURNS int AS 
BEGIN 
        DECLARE @MyVar int
        SET @MyVar=1
        RETURN @MyVar
END


Any ideas?




-----------------------------------------
Confidentiality Notice: This e-mail communication and any attachments
may contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, disclosure, dissemination,
distribution or copying of it or its contents is prohibited. If you
have received this communication in error, please notify me immediately
by replying to this message and deleting it from your computer. Thank
you.



More information about the dba-SQLServer mailing list