Information générale
Forum:
Microsoft SQL Server
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement