There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
IndexOutOfRangeException when moving large amounts of data
We are using SQL Server 2012 with version 4.0.15. Very often when we copy somewhat large (biggest tables containing 1 to 10 million rows) databases to Azure, tool crashes with IndexOutOfRangeException, originating apparently from BCPCommandCtrl.cs, method StringBuilder.ToString().
Usually this seems to happen when exactly 500 000 rows of a large table have been copied.
We figured this might have something to do with StringBuilder methods not being thread safe. Using lock statement to set lines using StringBuilder as critical sections seemed indeed to fix the problem (see attached patch).
Is this a known error, and do you think this is the right way to go about fixing it?