SQL Server System Functions

This page provides you with the commonly used system functions in SQL Server that return objects, values, and settings in SQL Server:

  • 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.
  • Convert datetime to string – Show you how to convert a datetime value to a string in a specified format.
  • Convert string to datetime – Describe how to convert a string to a datetime value.
  • Convert datetime to date – Convert a datetime to a date.
  • GENERATE_SERIES() – Generate a series of numbers within a specific range.