Question : SQL Function (scaler) totaling

I have a user defined function that is going to call another usering defined function.  How would i return the numeric value from the function that i am going to call?

Answer : SQL Function (scaler) totaling

An example

create function add2numbers(@a int, @b int) returns int as
begin
declare @returnvalue int
select @returnvalue = @a + @b
return @returnvalue
end
GO

Now in your other function you can call the above.

create function add3numbers(@a int, @b int, @c int) returns int as
begin
declare @returnvalue int
select @returnvalue = dbo.add2numbers(@a, @b)
select @returnvalue = dbo.add2numbers(@returnvalue, @c)
return @returnvalue
end
GO
Random Solutions  
 
programming4us programming4us