BCP error when migrating from SQL Azure

Feb 4, 2011 at 10:11 PM

I am trying to migrate my database from SQL Azure back to a local machine. I seem to be connecting properly, as it has no trouble reading the tables in the database, but I get the following error when I try to generate scripts. The error repeats for every table in the database. I do not get an error (at least not usually) when I try to analyze the tables without migrating.

Based on other threads, I checked the Path variable for SQL Server in Windows, and it does refer to version 100. I also made sure that I am using the latest version of the Migration Wizard (v.3.5.3).

Process started at 2/4/2011 5:42:39 PM -- UTC -> 2/4/2011 10:42:39 PM ...

Using BCP to get data from table [dbo].[aspnet_Applications]


SQLState = 08001, NativeError = 2

Error = [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [2].

SQLState = 08001, NativeError = 2

Error = [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

SQLState = S1T00, NativeError = 0

Error = [Microsoft][SQL Server Native Client 10.0]Login timeout expired


Feb 5, 2011 at 1:57 PM



Does this error occur during the export phase from your source SQL Server?  Or is this issue uploading data to the target (SQL Azure?) server?


Winerr 2 means "The system cannot find the file specified". This error message means the client can reach the server but there is no Named Pipe listener with specific pipe name on the target machine. It also means the account can have a file sharing session without a problem. Possible reasons are:

  • typo in instance name or wrong instance name. The instance name is not the one you are targeting. Note that for default instance, you shouldn't use MSSQLSERVER as instance name.
  • Target SQL Server is not running
  • Named Pipe is not enabled on the server. In this case, the SQL server is not listening on the specific pipe name.


I will be happy to take this offline with you to do lower level debugging.





Feb 5, 2011 at 7:45 PM

Hi George,

Thank you so much for your prompt reply. I've noticed that you reply to virtually all posts on this forum, and I really appreciate your dedication to this great project.

In response to your questions, this occurs when I try to copy from SQL Azure to my local machine. I had previously copied this data from my local machine to the SQL Azure (but then of course the data changed).

I am quite confident that I typed the name of the name correctly, xxx.database.windows.net (with xxx, of course, replaced with my assigned code). I also specified my username correctly as mbabramo@xxx . And I typed in the correct name of the database. It seems to me that all of this must be working correctly. I can use this same information to log into my database with the Azure Developer Portal. Moreover, the fact that the wizard seems able to read the table names and sort object dependencies suggests to me that this isn't a login issue.

You did mention the possibility that the Target SQL Server is not running. But the source server -- Azure -- is running, and I also have SQL Server on my local machine, although I have not gotten to the phase of the wizard where it asks me for that connection information yet.

Any help you can provide would be most appreciated! I will email you my info, including password (there isn't any real confidential info in the database yet).

Thanks already and in advance!


Feb 6, 2011 at 2:55 AM

With George's help, I eventually solved the problem. The key was that in the Connect To Server dialog, I needed to select the master database (and then select the specific database from the list on the next page) instead of typing in the name of the database. Thanks, George!

Feb 6, 2011 at 3:50 AM

Thanks for finding this problem.  Basically, SQLAZureMW puts the wrong server name in the BCP command when you select "Specify Database".  I will fix this in v3.5.4.

Thanks again!!!