Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transferring character field into numeric field
Message
 
 
To
22/10/2012 09:02:30
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01555436
Message ID:
01555450
Views:
51
>>ISNUMERIC function can give you false positives.
>
>For real? Can you describe in which occasions this may happen? In my test, I have a record containing mi5 in the record. I would still like to have the record to be imported in the new table but to have a 0 value in the new table numeric field. I would then believe that just using ISNUMERIC() wouldn't enough for that request. At first, I thought that I could use a syntax in the field level list so to have all the records but to convert into numeric, without receiving the error. Is that possible?
>
>>If you want to filter all non-numbers, use
>>
>>WHERE Column NOT LIKE '%[^0-9]%' -- double negative
>
>Thanks

1e5 or 1d4 should be treated as numeric by isnumeric function. In fact, Sergey has a blog on this very topic
http://berezniker.com/content/pages/sql/microsoft-sql-server/isnumericex-udf-data-type-aware
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform