Error using BCP via commandline, same comman did work last week.
-
So sometimes I use bcp from my c# and call it in a separate process while passing it command line arguments. I have been doing this for months, but today it started throwing an ambiguous error. I have changed nothing, so the sudden failure is proving difficult to resolve. I am still able to create the bcp format file, but when I try to insert a file I get: An error occurred while processing the command line. bcp PriceRecords.dbo.SVR5 in "C:\Code\b in\debug\SVR5\1220201093611.csv" -t',' -f "C:\Code\bin\Debug\SVR5.xml" -U xxxxxx -P xxxxxxn -S localhost\SqlExpress where xxxxxx = user and password Using MSSQL 2008, not seeing any error in the SQL logs.
-
So sometimes I use bcp from my c# and call it in a separate process while passing it command line arguments. I have been doing this for months, but today it started throwing an ambiguous error. I have changed nothing, so the sudden failure is proving difficult to resolve. I am still able to create the bcp format file, but when I try to insert a file I get: An error occurred while processing the command line. bcp PriceRecords.dbo.SVR5 in "C:\Code\b in\debug\SVR5\1220201093611.csv" -t',' -f "C:\Code\bin\Debug\SVR5.xml" -U xxxxxx -P xxxxxxn -S localhost\SqlExpress where xxxxxx = user and password Using MSSQL 2008, not seeing any error in the SQL logs.
-
It appears wrapping the table name in brackets fixed this issue. I have no idea why this error seemed to have spontaneously started.
Often wrapping the table in brackets fixes problems with naming conflicts, especially if the name conflicts with a reserved word. Of course I have no idea if that applies in your case.
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software