Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 error while creating a user defined function in sql 2000

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-09 : 06:06:32
Deepthi writes "hi,

I got one error while crating the user defined function in sql 2000. The following are the function and the error message


CREATE FUNCTION usrTest(@dd int)
RETURNS int AS
BEGIN
RETURN (2)
END

error:
******

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'FUNCTION'.
Server: Msg 178, Level 15, State 1, Line 4
A RETURN statement with a return status can only be used in a stored procedure.

It will be very thankful, if u can help me.

deepthi"

nr
SQLTeam MVY

12543 Posts

Posted - 2003-07-09 : 06:20:14
Are you running in v7 or less compatibility mode?
See sp_dbcmptlevel


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Edited by - nr on 07/09/2003 06:21:04
Go to Top of Page
   

- Advertisement -