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."