Sunday, August 31, 2008

SQL User Defined Functions

a. Scalar UDF: It returns a scalar value with datatype such as int, nvarchar, char, datetime and money
b. Table Valued UDF i. Inline Table value returning UDF -It defined with a single SELECT statement making up the body of the function. Inline table value-returning UDFs cannot contain additional T-SQL logic outside of the SQL SELECT statement that defines the table it will return. ii. Multistatement Table value returning UDF - This UDF is used if any additional logic needs to be included in the UDF in addition to select Statment. It allows to define multiple statement inside the UDF

No comments: