I have to import about 30 lacks of data from spreadsheet into the MSSQL DB. I used Entity Framework for Insert/ Update records into the database. But the default entity framework configuration was very slow performance. The constraint is, I need to verify the record before inserting into the table. If it existed then it should update with new values else it should insert new record into the database. But it is taking very large amount of time to Insert/Update records into database. I found a solution to speed up this process here.
Context.Configuration.AutoDetectChangesEnabled = false;
Above setting makes a huge difference in speed.
But the big problems, Records are not updated in table when I set AutoDetectChangesEnabled
to false
, but inserting
is fully functional.
Anyone else seeing this problem? Does anybody help to solve this problem?