In this class we are discussing about UDF's, UDF are used to reduce the manual effort and used to write complex computations and daily routine tasks. UDF can described in two types they are
1. Scalar ( Accepts Zero or More Params and returns a single Value, Its accept almost all sql server Data types except Ntext,varbinary)
-- and we can use in select query and where clauses
-2. Table Valued Functions
--i. Inline Table Valued Functions ( It contains Single Select statement , result will be on Table form start with Begin Ending END statement)
--ii. Multi Vlaued Table Functions ( It contanins multilple select statemtns or we can perform some operations)
-- Scalar Function
Synatx
CREATE FUNCTION FN_NAME
RETURNS RETURN-TYPE (DATA TYPE)
AS
BEGIN
SELECT STAT1,STAT2,....
RETRUN RETURN-VALUE
END
#database #userdefinedfunction #scalarfunctions #dataanalytics #dataanalysis