I have a table which includes 230 columns and 12 million rows.
I need to update 123 fields of EACH row.
If I try to do it with LINQ-To-Sql, I get System.OutOfMemory Exception.
I know I don't get OutofMemory error if I disable object tracking. But I think I cannot perform updates if I disable object tracking.
What is the best way to update them?
That is not a task suitable for LINQ-to-SQL, or frankly any ORM. You do not want to drag that much data twice over the network in that way; that should ideally be written in pure TSQL, perhaps using bulk insert / SqlBulkCopy
to populate a separate table if you need to combine with data from other sources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With