BCP export decimal using character data type result in ..000000000000?

  • I'm trying to get BCP to export decimal numbers correctly, and for some reason it cuts off the zero left of the decimal point. The command I'm currently using is:

    bcp "SELECT * FROM db.dbo.tbl " queryout C:\Fusion\Files\tbl.DAT -Ssqlserver -U user -P pwd -c -C RAW -t0xBF

    The above results in '.000000000000' for decimals. I've tried to use -n (native format) instead, but that creates some strange files, which EditPadPro opens in hexicmal format, I'm not sure about why this happens.

    The point of it is that I need to get the data in plain text format (being 8859-1 or like), and I need to get that missing zero in front of the decimal point.

    Any ideas on how to go about that?

  • I have the same problem.

    My dirty workaround was to to use nvarchar instead of decimal, it works but I'm not happy with that.

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

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