C# Optimisation: Inserting 200 million rows into database

前端 未结 3 2023
不知归路
不知归路 2021-02-10 11:41

I have the following (simplified) code which I\'d like to optimise for speed:

long inputLen = 50000000; // 50 million 
DataTable dataTable = new DataTable();
Dat         


        
3条回答
  •  伪装坚强ぢ
    2021-02-10 12:15

    You should not construct entire datatable in memory. Use this overload of WrtieToServer, that takes array of DataRow. Just split in chunks your data.

提交回复
热议问题