BCP Utility

  • Hello,

    I have been trying to import a text file into SQL Server 6.5 using the bcp utility. The columns are varchar and money datatypes. The problem is the values in the money datatype columns keep coming in as really odd, huge numbers(exponential) when the original amount was only 40.5. I tried to use diff. types like float and decimal, but this didn't work. I tried to do a test import of this same text file in SQL Server 2000 and had the same problem. The varchar data imports fine. The text file is a tab delimited file. One of the many statements I tried: BCP database.dbo.table in file_name /m1 /t\t /r\n /Sserver /Uuser /Ppwd

    Please assist.

    Thanks!

    Kim

  • Have you tried using a format file? Easiest way to create a format file is to BCP out from the destination table without providing any parameters. It will then prompt you for field definitions and you can then save those definitions in a format file to do the import.

    On another track, do you have connectivity between the SQL 6.5 and SQL 2000 servers? If so, why not use DTS on SQL 2000 to import the data into the SQL 6.5 database. DTS is a much friendlier interface to deal with

    Hope this helps

    Phill Carter

    --------------------

    Colt 45 - the original point and click interface

    --------------------
    Colt 45 - the original point and click interface

  • Hi Phill,

    Yes, I did try creating and using a format file to bcp in and out. Still got the same result going in, and bcp out, the money columns came out as garbled characters instead of numbers.

    In the end I did end up linking to SQL Server 2000 and using DTS. I agree it is much nicer. However, I'm still curious to figure out why the bcp utility is not working for me.

    Thanks for your help!

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

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