Try to cast a value to the specified data type.
If the cast not succeeds returns null.
Example
SELECT
CASE WHEN TRY_CAST('1' AS float) IS NULL
THEN 'Cast failed'
ELSE 'Cast succeeded'
END AS Result;
Result
SELECT
CASE WHEN TRY_CAST('xx' AS float) IS NULL
THEN 'Cast failed'
ELSE 'Cast succeeded'
END AS Result;
Result
Cast failed