SQL Server System Functions are built-in functions provided by Microsoft SQL Server that perform various tasks related to system information, data type conversion, string manipulation, date and time operations, mathematical calculations, and more. These functions are available for use within SQL queries and can help simplify and enhance the functionality of your database applications. Here are some commonly used SQL Server System Functions:
Function | Description |
CAST | Cast a value of one type to another |
CONVERT | Convert a value of one type to another |
CHOOSE | Return one of the two values based on the result of the first argument. |
ISNULL | Replace NULL with a specified value |
ISNUMERIC | Check if an expression is a valid numeric type |
IIF | Add if-else logic to a query |
TRY_CAST | Cast a value of one type to another and return NULL if the cast fails |
TRY_CONVERT | Convert a value of one type to another and return the value to be translated into the specified type. It returns NULL if the cast fails |
TRY_PARSE | Convert a string to a date/time or a number and return NULL if the conversion fails. |