bcp problem data changes

  • Can anyone please explain why, when I attempt to transfer data from a text file

    using bcp, that the first and fourth column though classified as an integers do not return the figures expected. i.e.

    txt 1, gregory, hill, 39

    txt 2, cleo, hill, 42

    sql 12567 gregory hill 52

    sql 12832 cleo hill 51

    I have even changed they classification to varchar and the figures still still come out incorrectly.

    Thanks!

  • Can you post you bcp command line?

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • quote:


    Can you post you bcp command line?

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)


  • quote:


    Can you post you bcp command line?

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)


  • I used two command lines one to create a format file the other to transfer the data. By the way, I'm a noivce, so I would appreciate plain speaking....cheers!

    bcp ineon..personal_details out c:\maggie6.txt /U sa /S LAPTOP

    bcp ineon..personal_details in c:\maggie3.txt /U sa /S LAPTOP /f c:\bcp3.fmt

  • Can you post the text data from the format file (you can open it in notepad), I just want to see what it thinks should be going on.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Hi Antares686

    Just solved the problem. Having read quite a bit on the web about this, I can't remember where I saw it but, I changed the bcp.fmt to transfer all the data in the form of SQLCHAR, when the data is transferred SQL server converts it into the actual classification of data i.e. int. As a consequence, the numeric data is now correct.

    Thanks.....for the jolt!

  • Great to hear, I figured something had to be changing it.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 8 posts - 1 through 7 (of 7 total)

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