You can execute the function as follows:
Create the function..
Create function Test(@i int)
returns int
as
begin
return @i+2
end
calling the function:
select dbo.Test(2);
If your function returns table, then you can also query as:
select * from dbo.function_name()