Objective: how to create function and then call in SQL Query in SQL Server 2008

Click rc->SVF->New Scaler value Function

CREATE FUNCTION AddTwoNumber
(-- Add the parameters for the function here
@A INT,@B INT
)
RETURNS INT
ASBEGIN
-- Declare the return variable here
DECLARE @Result As INT
-- Add the T-SQL statements to compute the return value here
SELECT @Result = @A+@B
-- Return the result of the function
RETURN @ResultEND
GO
Now see how I call this function in SQL QUERY
SELECT dbo.AddTwoNumber(2,2)


Yogesh BajpaiPosted Apr 29, 2013, 10:03 AM
Thx. Dear For appricite me.ya Sure i write calling user defined functions in Stored Procedure,Plese Stay Tuned
Ravikumar GPosted Apr 29, 2013, 7:43 AM
Simple and nice articles...can u plz write article for calling user defined functions in Stored Procedure...