Results 1 to 3 of 3

Thread: [mssql] I/O error while reading BCP format file

  1. #1
    Daniel Bolger Guest

    [mssql] I/O error while reading BCP format file

    Hi All,

    I had a problem today where BCP would not read the format file I created giving the following error:

    I/O error while reading BCP format file.

    I searched the archives here at swynk.com and found a thread titled exactly the same as the one I am now creating. There were numerous responses to this thread but none of them seemed to solve the problem for me (short of the one that suggested using BCP to create the format file, which I didn't want to do).

    I used BCP to create a format file for me (which looked identical to the format file that I created) and it worked fine. With my suspicions aroused, I used a binary file viewer to look at the contents of each file and highlight the differences. Apart from the usual variations in whitespace I noticed that the my file did not have any carriage returnline feed at the end of the last row definition.

    My format file ended at the end of the last row definition line. It did not have any carriage returns and line feeds. I matched the one generated by BCP and added the following "

    " to the end of the file, tested my format file and it worked perfectly.

    The moral of the story is, make sure when you create a format file, you have an empty line at the end of the file (ie: after your last "Server Column Name", make sure you have "

    " sans quotes).

    Hope this saves someone a few hours :-)

    Cheers,
    Dan.

  2. #2
    Join Date
    Nov 2007
    Posts
    1
    dude... you are a lifesaver.

    long live Dan!

    madan

  3. #3
    Join Date
    Feb 2021
    Posts
    1
    Cheers fella, you've saved me an afternoon of Googling

Posting Permissions

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