I have a pipe delimited text file which I bulk insert into a SQL table with all fields being of data type varchar. The problem I'm having is that when a value has four or more consecutive zeros after the decimal, casting from a varchar to a float results in scientific notation. For example [code="sql"]select cast('0.00004' as float)[/code] results in 4E-05 whereas [code="sql"]select cast('0.00044' as float)[/code] results in 0.00044 and [code="sql"]select cast('0.0004' as float)[/code] results in 0.0004. How can I avoid this while still casting as a float?
↧