i have a code like this
create function factfind(@num integer)
returns integer
as
begin
if (@num=1) then
return 1;
else
return(@num*factfind(@num-1));
end if;
end
errors was that, Msg 156, Level 15, State 1, Procedure factfind, Line 5 Incorrect syntax near the keyword 'then'. Msg 156, Level 15, State 1, Procedure factfind, Line 7 Incorrect syntax near the keyword 'else'. Msg 195, Level 15, State 10, Procedure factfind, Line 8 'factfind' is not a recognized built-in function name.
please help me friends.