Help needed with BCP/Fast import to Azure Sql Database

Hi,

I have a SQL Azure Database (not a VM) as well as a 2 gb txt file (stored on my local pc) I am attempting to import into a pre-existing table in the database.

I have attempted to use BCP using the following:

Bcp NA1.Pre_ETL.TableName in "\\mypc\c\\filename.txt"-n -U username@servername -S tcp:servername.database.windows.net -P password -b 100  -hTABLOCK

I get the following error: "Unable to Open BCP host data-file" when I run the above via command prompt on my local computer. Can anyone help me figure out what I am doing incorrectly?

Thanks in advance.

August 3rd, 2014 8:24pm

If the input file is on the local machine, have you tried just using c:\filename.txt for the filename?

Cheers, Bob

Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2014 10:51pm

Thanks Bob,

Yes, I have tried it both ways and receive the same error.

August 3rd, 2014 11:07pm

Solved
Free Windows Admin Tool Kit Click here and download it now
August 4th, 2014 2:50am

Hi Dylan Snyder,

According to your description, I do a test about importing data into SQL Azure database, it can run well. About your error message, I recommend you check the following points for troubleshooting your issue.

1) The path/filename is incorrect (check your typing / spelling);

2) The file does not exist (make sure the file is located in your local Server);

3) The file is already open by some other app (close the other app to release the file);

4) Make sure that bcp.exe can access the file/path .

There is an example about how to import /export data to SQL Azure databases using BCP and SQL Scripts, you can review the following article.

http://blogs.msdn.com/b/cesardelatorre/archive/2010/06/04/importing-exporting-data-to-sql-azure-databases-using-bcp-and-sql-scripts.aspx

Regards,
Sofiya Li

August 4th, 2014 2:54am

How did you solve this issue?  I am running into the same problem here.  Works on local SQLEXPRESS.  Reports error on Azure.
Free Windows Admin Tool Kit Click here and download it now
March 14th, 2015 11:02pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics