Search code examples
azure-sql-databasesql-server-2014updatebatchsize

Modify batch size for Sql Azure Database migration wizard


I am using Sql Azure Database migration wizard (https://sqlazuremw.codeplex.com/) to migrate databases from one instance to another instance. The default batch size is set to 1000, tried the following to increase the batch size

Modified the following in both SQLAzureMW.exe.config and SQLAzureMW.vshost.exe.config

<add key="BCPArgsIn" value="{0} in {1} -E -n -C RAW -b 1000 -a 4096"/>
<add key="BCPArgsOut" value="&quot;{0}&quot; out {1} -E -n -C RAW"/>

to

<add key="BCPArgsIn" value="{0} in {1} -E -n -C RAW -b 50000"/>
<add key="BCPArgsOut" value="&quot;{0}&quot; out {1} -E -n -C RAW -b 50000"/>

Still the default batch size is being taken as 1000 when its doing a BCP in or BCP out. How to fix this ?

The command has been changed to

bcp.exe dbname.dbo.tablename out C:\BCP_OUT\dbo_tablename.dat -E -n -C RAW -b 500000 -S servername -U "username" -P "mypassword"

but still its transferring only 1000 records at one shot.


Solution

  • Batch size option is valid only for BCP in but not BCP out. So all that needs to be done is to increase the packet size for BCP out (i have used -a 65535 which is maximum).