Creating a data access layer for an internal MVC application with Entity Framework and repository template. In some cases, I need to update, say, 100,000 rows in a table with 100 million rows in a SQL Server 2008 R2 database.
I use EF6, focusing on an existing obsolete database, which we refactor. I am new to Entity Framework but have a lot of experience with SQL Server.
No matter how I seem to structure my update instructions, when I run the profiler, I see 60k individual updates by ID. This may take up to 5 minutes. However, I say "batch number", which is indexed for a bunch of these records. Is there a way to UPDATE these records with a single where clause generated from EF? My solution was to simply write a simple sp, which then received an EF call.
c # sql-server entity-framework
jkerak
source share