Silent Failure of BCP Upload when Azure SQL DB name contains a "."


All data successfully exports out of my MS SQL database - .dat files are generated and the SQL is created.

The database name was formatted as "XXXX.YY-AAAA1"

I connected to my Azure SQL server and selected the database (with the same name -- I created it by hand from the management interface in the Azure Management Portal) with no error. All the SQL statements themselves executed correctly - the schema was created. It reported that all BCP files had exported ALL their rows to the database - no errors.

The row export did NOT happen. I tried it in data-only mode as well. BCP seems to fail silently. I tried uploading the .dat files by hand and all I obtained was the message, "An error occurred while processing the command line".

I ended up just deleting the database and renaming it something without the period. It worked fine at that point.


ghuey wrote Oct 17, 2012 at 12:26 AM

Wow, that is very interesting. I will see if I can replicate the issue. Thanks for the feedback. I hope the work around does not cause you too much pain.

Thanks again for the feedback.


ghuey wrote Oct 17, 2012 at 6:34 PM


Well bad news for me. I can't reproduce the problem. I created a database named [dbo].[XXXX.YY-AAAA1] and put 30 or so tables in with with data in each table. The export and import into SQL Database went well and all data got transfered. I hate to bother you, but if you could create a one or two table database that can repro the issue you reported and send it to me, that would be wonderful. If not, don't worry about it, I will keep this in mind and try different things until I find something. You can contabe me via codeplex if you are interested.


nate_leanserver wrote Oct 17, 2012 at 7:13 PM

Huh, okay. I'll get in contact with you George. Thanks.

wrote Feb 21, 2013 at 11:59 PM

icpear wrote Jul 31, 2013 at 4:37 PM

I was able to reproduce this bug. It occured for me when doing a SQL Azure to SQL Azure migration.

Generating the script and exporting data works. But when you try to run the script against a database with a period in the name like "my.database" the BCP fails but acts like it succeed.

For me I generated the script from "My.Database" on Azsure SQL Server 1. And then I tried running the script against "My.Database" on Azure SQL Server 2. The tables get generated but they dont populate with data.

1) Create a database with no period in the name (MyDatabaseNoPeriod)
2) Run the script against MyDatabaseNoPeriod
3) Delete old database (My.Datbase)
4) Rename MyDatabaseNoPeriod to My.Datbase*
  • I was cokpletely shocked that I was able to rename the datbase but it actually worked. I did it from SQL Server MAnagement studio. I literally just navigated to the database in the object explorer and right-clicked the database, and chose rename and it worked.

wrote Jul 31, 2013 at 4:38 PM

ghuey wrote Jul 31, 2013 at 10:27 PM


What version of SQL Server are you running SQLAzureMW on? Also, what version of SQLAzureMW are you running? I just tried to recreate the problem and everything works great on my machine. Basically what I did was:

1) Exported one of my local SQL Server databases
2) Using SQLAzureMW I created "My.Database-Test" in SQL Database
3) Ran the scripts against "My.Database-Test"
4) Verified that all data made it up to SQL Database
5) Exported "My.Database-Test"
6) Created "By.Geo-Test" DB in SQL Database
7) Ran the scripts against "By.Geo-Test" DB
8) Verified that all data made it up to SQL Database

So, from SQL Server to SQL Azure to SQL Azure everything worked well.

Another thing to check is bring up a command window and type "BCP /?". I have Version 6.3.9431 on my machine and you should see a -d database name option.