Search code examples
c#mysqlload-data-infile

Transfer data from SQL Server to MySQL


I need to transfer around 2m records from 4 tables in SQL Server 2008 Express to MySQL.

In C# I can insert these records very quickly within a transaction with the Table-Valued parameter. (Around 50 seconds).

How can I do something similar for MySQL in C#?


Solution

  • Read the explanations in the MySQL Reference Manual. The best you can do is use LOAD DATA INFILE while disabling indices before and recreating (and thus batch-calculating them) afterwards. There is more interesting advice if that doesn't work out for you.