HI ..
Please find details in below.
CREATE PROC fun_proc
@p_val1 int,
@p_val2 int
AS
BEGIN
Declare @sum int
select @sum = dbo.sums(@p_val1,@p_val2)
print @sum
END
create function sums
(
@val int,
@val2 int
)
returns int
as
begin
return(@val + @val2)
end
select dbo.sums(1,2)