How to create a SQL Function without input parameters
Im geting a error for following code
create function function_name
RETURN datetime AS
BEGIN
DECLARE @var datetime
SELECT @var=CURRENT_TIMESTAMP
RETURN @var
END
Error
>
> Msg 156, Level 15, State 1, Procedure
> fx_getcurrent_date, Line 2 Incorrect
> syntax near the keyword 'RETURN'. Msg
> 178, Level 15, State 1, Procedure
> fx_getcurrent_date, Line 7 A RETURN
> statement with a return value cannot
> be used in this context.