SQL: Odd TRY_CAST and TRY_CONVERT Behavior
Here’s a quick T-SQL test for you.
Without looking below to see the answer first, try to guess what each of these statements will produce as output:
SELECT TRY_CAST('' AS int);
SELECT TRY_CAST(' ' AS int);
SELECT TRY_CAST('' AS date);
SELECT TRY_CAST('' AS decimal(18, 2));
SELECT TRY_CONVERT(date, '', 103);
And to slightly distract you from checking out the answers yet, here is another wise-looking owl who is thinking about the answers, and warning you not to look further down the page yet:
2026-08-12