SQL Server : Explain System defined Functions in SQL database.

Aman Sharma
0
System Defined Functions:  These are the inbuilt functions in SQL server.  Thses functions are provided by sql sever for different purposes. Ex. Date functions and functions to get max value etc.

Description:


There are two type of system defined function:

1.      Scalar Functions: These functions accept input parameter and return single value.
   Some Useful Scalar Functions In SQL SERVER
Function
Description
rand(5)
Generate random no of 5 characters
upper('test')
Convert string to Upper case i.e. TEST
lower(‘TEST’)
Convert string to lower case i.e. test
ltrim(' test)
Remove spaces from left side of string
abs(-5.6)
Return absolute no of given input i.e. 5.6








2.      Aggregate Functions: These functions accept collection of values as input and generate single value result.


  Some Useful Aggregate Functions In SQL SERVER
Function
Description
avg()
Returns Average value from collection of values
Min()
Returns minimum  value from collection of values
max()
Returns maximum value from collection of values
count()
Returns count of collection of values

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !