What kind of User-Defined Functions can be created?

What kind of User-Defined Functions can be created?

We can a create User-Defined Functions in a many ways they are defined as :
> Scalar User-Defined Function :  A Scalar user-defined function is basically a return value like one of the scalar data types. It is not a type of supported data types like Text,next,image and timestamps. These are the type of user-defined functions and most developers are used to in other programming languages. We pass in 0 to many parameters and We get a return value.
> Inline Table-Value User-Defined Function : An Inline Table-Value user-defined function mainly returns the value like a table data type and It is an exceptional alternative to a view as the user-defined function, It can pass parameters into a T-SQL select command and Its is poivide the essence with a parametrized, non-updateable view of the underlying tables.
> Multi-statement Table-Value User-Defined Function : A Multi-Statement Table-Value user-defined function is bassically a returns a table and It is a type of view which we can say like an exceptional alternative view as the function can support multiple T‐SQL statements to build the final result where the view is limited to a single SELECT statement. And Its also the ability to pass parameters into a T-SQL select command or a group of them gives us the capability to in essence create a parameterized, non‐updateable view of the data in the underlying tables. Within the create function command you must define the table structure that is being returned. After creating this type of user‐defined function, It can be used in the FROM clause of a T‐SQL command unlike the behavior found when using a stored procedure which can also return record sets.


By:UMANG
Date:2010-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related SQL Subjective Links

SQL Subjective interview questions and answers for experienced and fresher