Recalculate large table in SQL database

We are struggling with this problem:

  • We have a large table in SQL Server 2008 R2(R2!) (Millions of rows)
  • We need to go through this table, and each row should be recounted by code C#(therefore, the table is loaded from the application C#)

How to do this if performance is critical? Some kind of package?

+3
source share
1 answer

If performance is critical, use the SQL CLR to calculate new values. You can simply use the update statement this way. The SQL CLR sets limits on the code you can use, so it may not be easy.

, SQL CLR :

, . :

  • (10 . )

, , . ID . ​​:

select top 10000 *
from T
where ID > @lastIDProcessed
order by ID

.

+2

All Articles