Importing data using bcp

  • HI all:

    Thanks so much for all of your help;
    Problem

    The issue I had with extracting my data had to do with the name of my format file. I had a  -c (tblCustodian-c.fmt) in the name. I think what  was happening was that the BCP client couldn't open   the format  file because of the  (-c) in the file name.  The client wasn't sure whether to read "-c" as  an argument....

    Solution
    I renamed the file to omit the -c and it worked perfectly.  I was able to extract the data I needed as well as do an import of the data into the table I was working with.

    Thanks again.

  • smatu - Saturday, February 4, 2017 2:04 PM

    HI all:

    Thanks so much for all of your help;
    Problem

    The issue I had with extracting my data had to do with the name of my format file. I had a  -c (tblCustodian-c.fmt) in the name. I think what  was happening was that the BCP client couldn't open   the format  file because of the  (-c) in the file name.  The client wasn't sure whether to read "-c" as  an argument....

    Solution
    I renamed the file to omit the -c and it worked perfectly.  I was able to extract the data I needed as well as do an import of the data into the table I was working with.

    Thanks again.

    Thank you very much for the feedback.  That is an odd problem, indeed.  One possible way to get around the problem without having to rename the file would be to put double-quotes around the file.  I've gotten into that habit whether it needs it or not.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thank you Jeff.

Viewing 3 posts - 16 through 17 (of 17 total)

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