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.
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.