I created a function in SQL Server 2012 Express with the code below.
CREATE FUNCTION IncAge(@Age AS INT)
RETURNS INT
AS
BEGIN
DECLARE @VAR AS INT;
SET @VAR = @Age + 10;
RETURN @VAR;
END
And when I try to call this function from query window, I get an error.
With SELECT IncAge(20) I get error
'IncAge' is not a recognized built-in function name.
With IncAge(20) I get error
Incorrect syntax near '20'.
So what is the problem??