Copy table and data from local SQL Server 2008 to SQL Azure database

Jul 8, 2011 at 10:00 AM

Hi all,

I have the scripts generated by SQL Azure Migration Wizard v3.7.4 (tables and its data) and when i run the script on the new query tab on SQL Azure, only the tables are created.

I know that the BCP data is specifited in the end of the script and IS COMMENTED. I want to know how to copy this database data (.dat file) to the database on the SQL Azure.

I have tried performing
BCP.EXE.[dbo].[DB_Attachments] in "c:\SQLAzureMW\BCPData\dbo.DB_Attachments.dat" -E -n -b 10000 -a 1638

but it doesnt work.

Can you please let met know how you copy the data from the BCP file to the database on azure.

Jul 8, 2011 at 9:44 PM




There is nothing that you have to do.  SQLAzureMW is a two part process. The first part exports the schema and data. The second part runs the TSQL generated by part 1 and the BCP commands against SQL Azure. You should be able to just hit the next button after everything is generated to select the target server. As a side note, the BCP command above is not complete. The second part of the process is when you identify the target server and then SQLAzureMW will insert the target server name into the BCP command completing the command.


Let me know if you have other questions.


Take care,


Jul 8, 2011 at 10:00 PM

Here is a quick video that walks you through SQLAzureMW:

Jul 11, 2011 at 3:57 AM

hi ghuey,

I was successful in migrating the data along with the tables. I used the command prompt to do it. Here is what i did.

bcp [DatabaseName].[dbo].[TableName] in [.DAT file full path] -S tcp:[ServerName], 1433(this number signifies which database you are using only if there are more than 2 databases in your account OR you can just stop at .net if you have only one database) -U [UserName of the Azure database]@[ServerName] -P [Password of the Azure database] -E -n -b 10000 -a 16384

The above code copied data for all the tables from on-premise computer to the Azure database.


Thank you very much for your time