BCP float data type question

  • Hi All,

    I need to BCP a file out and maintain it's format so it can be loaded into a system other than SQL Server. I have currently having a problem with the float data type.

    Please see this example:

    create table bcptest2

    (FlatRate float)

    insert into bcptest2

    select 0.003

    exec xp_cmdshell 'bcp YourDBName.dbo.bcptest2 out C:\\bcptest2.dat -c -C RAW -t"|" -T'

    Instead of outputting 0.003 I get 3.0000000000000001E-3.

    I need to use bcp to do this and have had a look on the MSDN website at the different format switches. Am I missing anything obvious?

    The system accepting the output is expecting a decimal value and therefore throws errors when it comes across this value.

  • Did you ever find a solution for the problem, as I'm having the exact same problem right now?

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply