skip to main |
skip to sidebar
UPDATE in Batches
WHILE (2 > 1)
BEGIN
BEGIN TRANSACTION
UPDATE TOP(100000)
<<TABLE>>
SET <<COLUMN>> = <<VALUE>>
WHERE <<WHERE_CLAUSE>>
IF @@ROWCOUNT = 0
BEGIN
COMMIT TRANSACTION
BREAK
END
COMMIT TRANSACTION
-- 1 second delay
WAITFOR DELAY '00:00:01'
END -- WHILE
Till Next Time
No comments:
Post a Comment