Creating an Out File with BCP

  • Hello,

    I am looking for an example of how to use the 'o' switch with BCP so that I can create an out file after BCP populates several tables.

    I have a batch file in which BCP populates thirty tables. I'd like to create an out file after the thirty tables are populated so that a vb6 application can know when the batch file is done.

    Any ideas?

    Thank you for your help!

    CSDunn

  • Although I have never used the -o switch, I do run a similar batch update.

    Within the batch file I log the results to *.log to provide an audit trail.

    bcp.exe "Select * from databasename..tablename" queryout c:\txt\output.txt -Sservername -Uusername -Ppassword -f c:\fmt\output.fmt -c >>c:\LOG\output_bcp.log

    I can query the log for the BCP results.

     

    JerseyMo

     

     

  • Thanks for the suggestion. I wound up abandoning my out file approach after I was able to implement a pretty good solution in the vb6 app using 'Shell and Wait'.

    CSDunn

Viewing 3 posts - 1 through 2 (of 2 total)

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