datetime tune date into pad dynamic cursor money percent sp job isnumeric while over update
FREE TRIAL  SQL 2012 PROGRAMMING  SEARCH
SQL Server Scripts SQL 2005 SQL 2008 Articles
SQL JOBS NEWS FORMAT DEV JOBS
How to update 5 million home equity loan accounts?

The following Microsoft SQL Server Transact-SQL script demonstrates how to perform millions of updates, in batches of 1000 at a time, on home equity loan accounts without bringing the system to a halt:

use FirstFidelityMasterArchive;

use HomeEquityLoan;

 

set rowcount 1000

while exists( select 1 from Payment where Cleared = 0 )

begin

  update Payment set Cleared = 1 where Cleared = 0

 

  waitfor delay '000:00:01'

 

end

set rowcount 0

-- End of Home Equity Loan Star nightly processing cycle

 

Related article:

http://www.sqlusa.com/bestpractices/largeupdate/

 

Exam Prep 70-461
Exam 70-461