Answer» The SQL Server has many builtin functions some of which are listed below: - SQL Server String Functions:
The table below lists some of the String functions in SQL with their description:
| Name | Description |
|---|
| ASCII | Returns ASCII values for a specific character. |
|---|
| CHAR | Returns character based on the ASCII code. |
|---|
| CONCAT | Concatenates 2 strings together. |
|---|
| SOUNDEX | Returns similarity of 2 strings in terms of a 4 character code. |
|---|
| DIFFERENCE | Compares 2 SOUNDEX values and returns the result as an integer. |
|---|
| SUBSTRING | Extracts a substring from a given string. |
|---|
| TRIM | Removes leading and trailing whitespaces from a string. |
|---|
| UPPER | Converts a string to upper-case. |
|---|
- SQL Server Numeric Functions:
The table below lists some of the Numeric functions in SQL with their description:
| Name | Description |
|---|
| ABS | Returns the absolute value of a number. |
|---|
| ASIN | Returns arc sine value of a number. |
|---|
| AVG | Returns average value of an expression. |
|---|
| COUNT | Counts the number of records returned by a SELECT query. |
|---|
| EXP | Returns e raised to the power of a number. |
|---|
| FLOOR | Returns the greatest integer <= the number. |
|---|
| RAND | Returns a random number. |
|---|
| SIGN | Returns the sign of a number. |
|---|
| SQRT | Returns the square root of a number. |
|---|
| SUM | Returns the sum of a set of values. |
|---|
- SQL Server Date Functions:
The table below lists some of the Date functions in SQL with their description:
| Name | Description |
|---|
| CURRENT_TIMESTAMP | Returns current date and time. |
|---|
| DATEADD | Adds a date/time interval to date and returns the new date. |
|---|
| DATENAME | Returns a specified part of a date(as a string). |
|---|
| DATEPART | Returns a specified part of a date(as an integer). |
|---|
| DAY | Returns the day of the month for a specified date. |
|---|
| GETDATE | Returns the current date and time from the database. |
|---|
- SQL Server Advanced Functions:
The table below lists some of the Advanced functions in SQL with their description:
| Name | Description |
|---|
| CAST | Typecasts a value into specified datatype. |
|---|
| CONVERT | Converts a value into a specified datatype. |
|---|
| IIF | Return a value if a condition evaluates to True, else some other value. |
|---|
| ISNULL | Return a specified value if the expression is NULL, else returns the expression. |
|---|
| ISNUMERIC | Checks if an expression is numeric or not. |
|---|
| SYSTEM_USER | Returns the login name for the current user |
|---|
| USER_NAME | Returns the database user name based on the specified id. |
|---|
|