Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting nvarcher to numeric
Message
De
02/04/2001 14:45:45
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00490968
Message ID:
00491030
Vues:
11
>When I using CONVERT function to convert nvarchar to numeric, I getting error message "Error converting data type nvarchar to numeric".
>I read help, and figured out that it is because there is charachters inside nvarchar variable.
>But is it possible to convert the same variables without errors, but zeros instead? :)

I am not to good with regular expression, but you could probably use them to change all non-numeric charaters to a 0.

Something like...

SET @myvar = REPLACE(@myvar,'[A-Za-z]','0')

BOb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform