How to write an error message from an BCP operation to a log file and stop processing the batch file
- by Newbie
I have a BCP operation in a batch command file. when there is an error in the BCP Operation I need to stop the processing and write the err msg in the log file
I've used to -e option to write the error message during a BCP operation to a err file. The err file is getting created in the location but does not contain any error message written to it.
My BCP statement is like this.
BCP DbName.dbo.tableName In FileLocation -e Errorfile -S ServerName -T -c
Is there a way to get the error level and then stop the processing.
Appreciate quick help.