Menu

SQL Server Type Conversion Functions

This page lists the commonly used data type conversion functions in SQL Server.

Use TRY_CONVERT() when a supported conversion may fail and the query should receive NULL for invalid values; use CONVERT() for explicit conversions that should raise an error on invalid input.

  1. CAST

    The CAST() function is a type conversion function in SQL Server that converts a value of one data type to another.
  2. CONVERT

    The SQL Server CONVERT() function is used to convert a value of one data type to another data type.
  3. TRY_CONVERT

    Learn how SQL Server TRY_CONVERT() returns NULL for failed conversions, supports date styles, and still rejects explicitly disallowed conversions.