TRY_CAST replaces only execution errors with NULLs. However, during planning, impossible casts between two non-castable types still produce an error because the query is invalid.Syntax
Parameters
Return Type
ReturnsNULL if the conversion cannot be performed. Otherwise, returns the data type of <type>.
Example
The following example attempts to cast the level input as an integer:Rows: 1Execution time: 5.29ms