I found this very annoying bug while converting EmployeeID values with ISNUMERIC:
SELECT DISTINCT [EmployeeID],
ISNUMERIC(ISNULL([EmployeeID], '')) AS [IsNumericResult],
CASE WHEN COALESCE(NULLIF(tmpImport.[EmployeeID], ''), 'Z')
LIKE '%[^0-9]%' THEN 'NonNumeric' ELSE 'Numeric'
END AS [IsDigitsResult]
FROM [MyTable]
This returns:
EmployeeID IsNumericResult MyCustomResult ---------- --------------- -------------- 0 NonNumeric 00000000c 0 NonNumeric 00D026858 1 NonNumeric (3 row(s) affected)
Hope this helps!