Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transferring character field into numeric field
Message
 
 
À
22/10/2012 09:02:30
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01555436
Message ID:
01555450
Vues:
50
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform