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
 
gives you:
Server: Msg 1075, Level 15, State 1, Procedure fn_something, Line 5
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
Categories: Uncategorized
  1. marisha's avatar
    marisha
    May 22, 2012 at 5:12 pm

    Thank you I used your link to solve the same problem I was getting

    Like

  1. No trackbacks yet.

Leave a comment