Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7833125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:34:29+00:00 2026-06-02T12:34:29+00:00

We are fighting this problem: We have a big table in SQL Server 2008

  • 0

We are fighting this problem:

  • We have a big table in SQL Server 2008 R2 (R2 !) (millions of rows)
  • We need to walk through this table and each row needs to be recomputed by a C# code (so the table is loaded from C# application)

How to do that if performance is crucial? Some kind of batching?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:34:36+00:00Added an answer on June 2, 2026 at 12:34 pm

    If performance is crucial, use SQL CLR to compute the new values. You can just use an update statement that way. SQL CLR places restrictions on what code you can use so this might not be an easy option.

    There is another way if SQL CLR is not an option:

    I assume there is an integer primary key. I’d do it like this:

    • request a batch of rows (10k or so)
    • compute the updates
    • send the updates
    • repeat

    The trick is to keep track of which rows you already processed. Keep the ID value of the last row processed. Request a batch like this:

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

    That will guarantee fast an reliable execution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been fighting this crazy problem for hours and have gotten nowhere. I have
I have been fighting this problem with the help of a RegEx cheat sheet,
Hi there I have big problem with one select query There is a table:
For the last 2 hours I have been fighting with this problem and trying
I'm fighting with this database and i have a strange problem... If I try
I've been fighting this problem for many hours now and could really use some
I've been fighting with this problem all day and am just about at my
I have been fighting with this for quite some time and have found a
I have a problem with this jquery script. toggle:function() { if(this.opened){ $(slideToBuyBottomBtnClosed).setStyle(display,block); $(slideToBuyBottomBtnOpen).setStyle(display,none); $(sildeToBuyContent).setStyle(overflow,hidden);
There is this strange situation I'm fighting on. I have 3 pages, les call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.