SQL

Create a stored procedure that will add 2 variables

CREATE PROCEDURE sumVariables
	@var1 int,
	@var2 int,
	@varTotal int output
AS
BEGIN
	SET @varTotal = COALESCE(@var1,0) + COALESCE(@var2, 0)
END

 Call the sumVariables procedure

declare @result int
exec sumVariables 2,3, @result output
select @result