Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot create a function
Message
 
 
À
03/01/2006 12:53:11
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01082707
Message ID:
01082715
Vues:
14
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform