sql server 2012 - SQL Error - varchar to numeric -


i imported flat file sql database , created of fields varchar(50). able change data type of fields, hit error in weight field. of data in weight field less 6 characters in total length , either whole integer or decimal. have tried both:

update mawb set weight = cast(weight decimal(12,2))

and:

alter table mawb alter column [weight] decimal(10,2)

i error: error converting data type varchar numeric.

i've checked of fields considered numeric using:

select count(*) mawb isnumeric(weight) = 0

i've tried ltrim , rtrim safe, still error when try change field. know else might causing error?

you can find offending rows query:

select * mawb try_convert(decimal(12,2),weight) null , weight not null 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -