April 23, 2002 at 2:56 pm
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!
April 23, 2002 at 3:33 pm
Can you post you bcp command line?
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
April 23, 2002 at 3:41 pm
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)
April 23, 2002 at 3:42 pm
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)
April 23, 2002 at 3:46 pm
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
April 23, 2002 at 7:25 pm
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)
April 24, 2002 at 3:21 am
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!
April 24, 2002 at 4:13 am
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