What are the type of function in sql server?

Posted by Saranya Boopathi under Sql Server on 3/27/2014 | Points: 10 | Views : 754 | Status : [Member] | Replies : 4
What are the type of function in sql server?

Saranya Boopathi


Responses

Posted by: A2H on: 3/27/2014 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,
SQL Server 2008 supports
user-defined functions and built-in functions

User Defined Functions includes
Scalar Functions :
User-defined scalar functions return a single data value of the type defined in the RETURNS clause. For an inline scalar function, there is no function body; the scalar value is the result of a single statement. For a multistatement scalar function, the function body, defined in a BEGIN...END block, contains a series of Transact-SQL statements that return the single value. The return type can be any data type except text, ntext, image, cursor, and timestamp.
TableValued Function

User-defined table-valued functions return a table data type. For an inline table-valued function, there is no function body; the table is the result set of a single SELECT statement.

Built In Functions:
Built-in functions are provided by SQL Server to help you perform a variety of operations. They cannot be modified.

You can check the below link for more details
http://www.dotnet-tricks.com/Tutorial/sqlserver/KY3T010412-Different-Types-of-SQL-Server-Functions.html
http://technet.microsoft.com/en-us/library/ms177499(v=sql.105).aspx

Please mark my reply as answer if it helps you

Thanks,
A2H
My Blog

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saranpselvam on: 4/7/2014 [Member] Starter | Points: 25

Up
0
Down
1.System Defined Function
2.User Defined Function

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 4/7/2014 [Member] [MVP] Silver | Points: 25

Up
0
Down
Types of Function

01. System Defined Function.
-> Scalar Function: Scalar functions operates on a single value and returns a single value.
-> Aggregate Function: Aggregate functions operates on a collection of values and returns a single value.

02. User Defined Function.
-> Scalar Function: User defined scalar function also returns single value as a result of actions perform by function.
-> Inline Table-Valued Function: User defined inline table-valued function returns a table variable as a result of actions perform by function.
-> Multi-Statement Table-Valued Function: ser defined multi-statement table-valued function returns a table variable as a result of actions perform by function.

Happy coding.

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 4/15/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer the below link for detailed examples
http://www.sqlteam.com/article/user-defined-functions

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response