I’m using the MySql connector for .NET to copy data from MySql servers to SQL Server 2008.
Has anyone experienced better performance using one of the following, versus the other?
- DataAdapter and calling Fill to a DataTable in chunks of 500
- DataReader.Read to a DataTable in a loop of 500
I am then using SqlBulkCopy to load the 500 DataTable rows, then continue looping until the MySql record set is completely transferred.
I am primarily concerned with using a reasonable amount of memory and completing in a short amount of time.
Any help would be appreciated!
I’ve used SqlBulkCopy with DataReader when processing large amounts of data. I’ve found the process to be quite efficient in terms of speed and memory usage, since the entire data set is not retrieved before copying. I recommend setting the BatchSize property to some reasonable value, say 500 in your case.