What are functions in SQL server?

928    Asked by JackRussell in SQL Server , Asked on Jan 12, 2020
Answered by Rachit Gupta

It is a database object which can accept input parameters and process the statements and provide the result (single value/data set) function will always return a value. Function is found in Sys.objects with type=’FN’ or it can be extracted from database objects. The function name can’t exceed 128 characters.

Functions are mainly defined into 2 categories:

1. User defined functionà functions which are created by uses

2. System defined functionà functions which defined by default by the system on installation of SQL server

User defined function can be further be divided into 3 parts:

1. Table- valued functions à there are functions which return table as output

2. Scalar- valued functionsà there are functions which return value as output

3. Aggregate functions à there are functions which are used for some mathematical work


Your Answer

Interviews

Parent Categories