I uploaded a CSV which automatically converted all my columns to varchar. I need to convert the value 22.30 to 0.223.
alter table badv2018
alter column [BB
Make it a wider value. For instance:
alter table badv2018
alter column [BB Percent] decimal(10, 3)
(4, 3)
can only represent values from 0.000 to 9.999. You probably really want (6, 3)
, so 10 is overkill.
You can then add another column with the result you want:
alter table badv2018
add column bb_ratio as ([BB Percent] / 100);