General information
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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only