BCP data extraction failed

Aug 17, 2010 at 9:22 AM


After running the tool for analyzing and migrating SQL to SQL Azure, i got the following error

Using BCP to get data from table dbo.SuccessStatus


Could not find number of records copied. File will not be uploaded.
bcp.exe:  unknown option d

 usage: bcp.exe {dbtable | query} {in | out | queryout | format} datafile  ...bla bla

BCP output file: "c:\SQLAzureMW\BCPData\dbo.SuccessStatus.dat"


I think that it's a commandline issue you execute from code...am i right?



Aug 17, 2010 at 5:44 PM

The problem is that I parse the output from BCP and look for the rows copied. If you look in the SQLAzureMW.exe.config file you will see the Regex for this (look at key BCPRowsCopied). The problem usually is that my system is setup in English and if your system is setup for a different language, then the output from BCP will reflect that language. This means that you would have to modify the Regex search string to reflect your language. The best way to do this is to do a BCP from a command line and point to one of your tables and at the end, look at the rows copied and make the BCPRowsCopied match. If you want, copy the last part of your BCP output and send it to me and I will figure out your regex string.

 Regards, George

Sep 8, 2010 at 10:01 AM

Hello. Good Nigth.

I have the same error.

But my SO is in english...

I try to send you the line.. but Im using this comand line=

bcp name_DB.dbo.t_pais out t_pais.tbl -T -S localhost\sql2008

But i can not copy the last line because have special characters.

What can i do?


Sep 8, 2010 at 4:48 PM

I believe that the problem is with the version of BCP that you are running.  Check out this thread: http://sqlazuremw.codeplex.com/Thread/View.aspx?ThreadId=225140 and see if that helps.  If not, let me know.


Sep 9, 2010 at 12:11 AM

In short, the old version of BCP does not support the -d (database) switch.  The new version of BCP (Version 10.50.1600.1) supports the -d switch.  So, you will need to update your PATH to point to the new SQL Server tools so that the right version of BCP gets executed.