Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting nvarcher to numeric
Message
From
02/04/2001 14:45:45
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00490968
Message ID:
00491030
Views:
9
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform