In SQL Server, the TRY_CONVERT()
function is very similar to the CONVERT()
function, except that TRY_CONVERT()
doesn’t return an error if the conversion fails (CONVERT()
does).
Instead, the TRY_CONVERT()
function returns NULL
if the conversion doesn’t succeed.
There are some occasions however, where TRY_CONVERT()
will return an error.