|
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/
|