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 /
SqlBulkCopyto populate a separate table if you need to combine with data from other sources.