Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command line BCP return code?

Status
Not open for further replies.

philmck

Programmer
Feb 19, 2004
8
GB
I have inherited a batch script which runs a number of bcp commands. My problem is that it currently tries to use the DOS style errorlevel to check for errors:

bcp "DB..TABLE" in textfile.asc .......etc
if errorlevel 1 ...etc
bcp "DB..TABLE2" in textfile2.asc .......etc
if errorlevel 1 ...etc

It seems the errorlevel is not set when bcp fails. Wondering if there is a return code or some way of trapping the error when using command-line bcp ?

Any suggestions appreciated, thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top