2
Vote

Only schema is getting copied and no data

description

I am trying to copy the sql azure database to sql server. I tried sql server 2008 R2 and sql sever 2012. This utility only copies the schema over but not data. Is this a bug being worked on or I am missing something.

Thanks for this utility.. :)

file attachments

comments

ghuey wrote Dec 16, 2012 at 4:34 AM

Hi,

You should see a couple of things. 1) when you export your database, you should see a BCP summary at the bottom of the script. So, is that there? 2) If you look at the output directory, you should see a bunch of .dat files. Are they there? When you import into SQL Database, you should see multiple tabs showing BCP uploading data and the BCP output should be in the main results window. Do you see anything there? You need to be sure that you are running SQL Server 2008 R2 SP1 and that when you do BCP /v from a command prompt that BCP version is 10.50 or greater. If you want, you can contact me offline.

Regards,
George

Maorrin wrote Mar 8 at 12:08 AM

Hello.
I've got very similar problem.
I try to migrate DBs from SQL Server 2012 to Azure and all I get is schema without data. The process is running without explicit errors:
1) there is BCP summary (as I understand it):
...
bcp.exe "[dbname].[dbo].[UserProfile]" out "c:\SQLAzureMW\BCPData\dbo.UserProfile.dat" -E -n -C RAW -S localhost -U "username" -P "pass"
bcp.exe "[dbname].[dbo].[webpages_Membership]" out "c:\SQLAzureMW\BCPData\dbo.webpages_Membership.dat" -E -n -C RAW -S localhost -U "username" -P "pass"
Analysis completed at 07.03.2014 23:46:16 -- UTC -> 07.03.2014 21:46:16
Any issues discovered will be reported above.
Total processing time: 0 hour, 1 minute and 53 seconds
2) there are .dat files in output directory.
3) I'm running SQL Server 2008 R2 SP1 with BCP v11.0.2100.60.

But there is one thing with encoging. Everywhere in log I get such messages:
SQLAzureMW could not find the number of rows copied in the BCP output.  Here is the BCP command:
BCP "[dbname].[dbo].[user_contacts_types_Translate]" out "c:\SQLAzureMW\BCPData\dbo.user_contacts_types_Translate.dat" -E -n -C RAW -S localhost -U "user" -P "pass"

Here is the BCP output:
ìáτáΓ« ¬«»¿α«óá¡¿Ñ...
欫»¿α«óá¡« ßΓ᫬: 7.
ÉẼÑα ßÑΓÑó«ú« »á¬ÑΓá (ó íá⌐Γáσ): 4096
éαѼ∩ (¼ß) éßÑú«     : 1      é ßαÑñ¡Ñ¼ : (7000.00 ßΓ᫬ ó ßѬπ¡ñπ.)

Here is the Regex string being looked for: [0-9]+\srows copied

Using BCP to get data from table [dbo].[user_contacts_types]
bcp.exe "[dbname].[dbo].[user_contacts_types]" out "c:\SQLAzureMW\BCPData\dbo.user_contacts_types.dat" -E -n -C RAW -S localhost -U "user" -P "pass"
*
I've tried to run one of these bcp commands via console with -w parameter and got nice result in txt file.
But changing -n parameter to -w in SQLAzureMW configuration does not solve my problem.

Thank you for attention :)

ghuey wrote Mar 8 at 3:06 AM

Hi,

My first guess is that you default language is set to something I don't have coded for. Here are the languages that I have covered to date:
    af-ZA – Afrikaans (South Africa)
    zh-CN – Chinese (Simplified, PRC)
    ja-JP – Japanese 
    es-ES – Spanish (Spain) 
    fr-FR – French 
    de-DE – German (Germany) 
    it-IT – Italian 
    nl-NL – Dutch (Dutch)
    nl-BE – Dutch (Belgium)
    pt-BR – Portuguese (Brazil) 
    pt-PT – Portuguese (Portugal)
    zh-CN – Chinese (Simplified, PRC)
    zh-TW – Chinese (Taiwan)
    English
If you have a default language set to something else, then we need to translate and add it to SQLAzureMW.exe.config. You can take a look at the file and see what I am talking about at the top. Anyway, I believe that I generate all of the BCP commands for you and what you can do is just copy the commands and paste them in a command window and run. You data should be uploaded and you should be good to go.

If your default language is one of the listed above, then I will need to do more debugging.

Let me know.

Thanks,
George

Maorrin wrote Mar 11 at 11:40 AM

Indeed, default language of my SQL Server is Russian, but language of the db user is English. Databases are not my specification and I have not delved into that :)
So I've successfully extracted and transfered data using your BCP script. The problem is solved.

Thank your for help and for this extremely usefull tool! 5 stars.

ghuey wrote Mar 11 at 6:24 PM

Hi,

I am very happy that you are up and running. If you don't mind, it would be great if I could add a "Russian" section to the config file, but I would need your help to fill in the Russian BCP section. Here is an example:

<ru-RU>
<add key="BCPRowsCopied" value="[0-9]+\srows copied"/>
<add key="BCPWarning" value="Warning:"/>
<add key="BCPError" value="Error ="/>
<add key="BCPSQLState" value="SQLState ="/>
<add key="BCPTotalSent" value="Всего Отправлено: [0-9]+\W+SQLState ="/>
<add key="BCPNumber" value="[0-9]+"/>
<add key="BCPSummary" value="Будильник[\w\W]+sec.\)"/>
<add key="BCPCodePage" value="437"/>
</ru-RU>

The three that I really need translated are: 1) BCPRowsCopied, 2) BCPTotalSent, and 3) BCPSummary. The best way to do this is to use a BCP command to export and import some data into a dummy table to see the BCP output. For example, if I had a database DeleteMe with a table Customers, I could export the data with the following BCP command:
 bcp DeleteMe.dbo.Customers out delme.dat -S localhost -n -E -T
This should give you the output you need for BCPRowsCopied.

Here is an example BCP command to upload the data:
bcp DeleteMe.dbo.Customers in Customers.dat -S localhost -n -E -q -T -b 20
This should give you the output you need BCPTotalSent and BCPSummary.

Anyway, if you want, run the BCP commands and just save the output to a text file and send it to me and I will see if I can find the information that I need.

As a side note, if you are busy and don't have the time to mess with this, no problem. I hate to impose upon people. Feel free to contact me offline via Codeplex if you wish.

Thanks very much for your time,
George

Maorrin wrote Mar 13 at 3:12 PM

Hello!
Here I attach the file with translations, I hope it can be a little bit usefull :)
If necessary, I will make corrections or give you more information with pleasure.