SELECT   
    CASE WHEN TRY_CAST('test' AS FLOAT) IS NULL   
    THEN 'Cast failed'  
    ELSE 'Cast succeeded'  
END AS Result;  
GO  
SELECT   
    CASE WHEN TRY_CAST('test' AS CHAR(10)) IS NULL   
	THEN 'Cast failed'  
	ELSE 'Cast succeeded'  
END AS Result;  
