SQL server ISNUMERIC and checking for valid numeric tyopes
Posted by: SQL Server DBA,
on 30 Jan 2012 |
View original | Bookmarked: 0 time(s)
During a large ETL process from a staging table , UPDATE was creating an error on a CONVERT.Msg 245, Sev 16, State 1, Line 17 : Conversion failed when converting the nvarchar value '??u? ? ? ?AA???????????W?????????a??????K???????????????????1217' to data type int. [SQLSTATE 22018]
It was necessary to create a step , where values could be checked , if they were a valid numeric type. ISNUMERIC returns 1 if its a valid numeric data type ( int, bigint, smallint, tinyint, decimal,numeric,money,smallmoney,float,real)SELECT...