I upgraded our Windows Server from 2008 to 2012 and the SQL Server from 2008 to 2014. I have a process that uses the BCP
command to export data from the database. The command is below:
bcp "exec db_name.dbo.table_name 20160204, 0" queryout D:\myfolder\201602\20160204\output.txt -c -T -S SERVER_NAME
Before the upgrade
2016-02-02 04:05:16,038 [2492] INFO -
Starting copy...
1000 rows successfully bulk-copied to host-file. Total received: 1000
After the upgrade
2016-02-05 04:04:37,006 [15872] INFO -
Starting copy...
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC Driver 11 for SQL Server]Warning: BCP import with a format file will convert empty strings in delimited columns to NULL.
1000 rows successfully bulk-copied to host-file. Total received: 1000
Though the output file has been created, the Error/Warning is something that is undesirable in the log. Is there a way to suppress this warning?
Apparently,according to Microsoft this is not an error but just a warning and can be safely ignored.(Detailed discussion and work around here)
In my case, I was parsing the BCP console output for string "Error" and reporting that the process failed. Since I am using the Process
class of .NET framework to call the BCP command in C# code, I had to add code to check for process exit code 0 and suppress this specific warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With