I have a SSIS Execute Process Task which calls a .bat file which calls SQL Server BCP IN to move data from a file to SQL Server.
Now even if BCP IN fails to transfer some records (due to data type mismatch) Execute Process Task does not fail. We want Execute process task to fail in this condition. How can this be done?
When we run BCP IN directly on command prompt we get below kind of messages for records which BCP IN fails to transfer.
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0]String data, right truncation
We tried to use %ERRORLEVEL% but it remains set to 0.