Results 1 to 2 of 2

Thread: BCP how to

  1. #1
    Dennis Davison Guest

    BCP how to

    Hello,

    Im new to SQL and in need of how to use BCP. I have a file called data.txt and a table called test. I tried to do:

    bcp a.dbo.test in c:data.txt -ec:err.log /Usa /P -F2

    and I get errors whats in my err.log is:

    #@ Row 2, Column 1: Unexpected EOF encountered in BCP data-file. @#

    No data gets put into the table.

    Im using as the field terminator and
    as the row terminated (I also tried
    as the terminator, but same error) I know Im doing something wrong, but what am I doing wrong?

    The file data.txt was created in Excel and saved as a DOS TXT file.

    Thank you in advance for all help given.

  2. #2
    Patrick Guest

    BCP how to (reply)

    Hello Dennis,
    My first remark is around the Pwd not mentionned on your message, don't forget it in the run.
    Now the techy.
    Because you don't indicates the kind of file you furnish in input, BCP assumes the 'database format' unfortunatly, you have a flat txt file.
    So, a Format file is needed and the switch /c included in your command.
    How to do a format file ? good question. Go to the BOL (books OnLine) and read the how to do that.
    Reagrds
    Patrick


    ------------
    Dennis Davison at 7/30/01 2:06:57 PM

    Hello,

    Im new to SQL and in need of how to use BCP. I have a file called data.txt and a table called test. I tried to do:

    bcp a.dbo.test in c:data.txt -ec:err.log /Usa /P -F2

    and I get errors whats in my err.log is:

    #@ Row 2, Column 1: Unexpected EOF encountered in BCP data-file. @#

    No data gets put into the table.

    Im using as the field terminator and
    as the row terminated (I also tried
    as the terminator, but same error) I know Im doing something wrong, but what am I doing wrong?

    The file data.txt was created in Excel and saved as a DOS TXT file.

    Thank you in advance for all help given.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •