Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot create a function
Message
 
 
To
03/01/2006 12:53:11
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01082707
Message ID:
01082715
Views:
13
I don't get any errors running your script. The function is created successfully and works properly. I'm connecting to SQL 2000 SP3.

>I'm trying to create a simple function
>
>CREATE FUNCTION Add2Numbers (@X INT, @Y INT)
>RETURNS INT
>AS
>BEGIN
>   DECLARE @Z INT
>   SET @Z = @X + @Y
>   RETURN(@Z)
>END
>
>
>Getting error:
>"Error 170: Line1: Incorrect syntax near 'FUNCTION'.
>Must declare the variable '@X'.
>A RETURN statement with a return value cannot be used in this context."
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform