I have a varchar field with some data and I need to cast those values and insert into float data type field
create table #tableTest
(
someData varchar(100) not null
);
insert into #tableTest(someData) values('5 215 243');
create table #tableFloat
(
floatData float not null
);
insert into #tableFloat
select someData from #tableTest;
I tried this :
insert into #tableFloat
select replace(someData, ' ', '')
from #tableTest
I except the result to be table #tableFloat have values 5215243.00 by removing the spaces in between them