Home
> Uncategorized > RETURN statements in scalar valued functions must include an argument.
RETURN statements in scalar valued functions must include an argument.
Ever get one of those vague error messages back from SQL server, for once, I decided to throw a bit of light on this gem "RETURN statements in scalar valued functions must include an argument."
It occurs when you omit the brackets after a return statement in a User defined function i.e
create function fn_something(@something float)
returns float
as
begin
return
select @something + 10
end
returns float
as
begin
return
select @something + 10
end
gives you:
Server: Msg 1075, Level 15, State 1, Procedure fn_something, Line 5
RETURN statements in scalar valued functions must include an argument.
RETURN statements in scalar valued functions must include an argument.
but this works
create function fn_something(@something float)
returns float
as
begin
return ( select @something + 10 )
end
returns float
as
begin
return ( select @something + 10 )
end
Categories: Uncategorized
Thank you I used your link to solve the same problem I was getting
LikeLike