I\'ve an UPDATE statement which can update more than million records. I want to update them in batches of 1000 or 10000. I tried with @@ROWCOUNT bu
UPDATE
@@ROWCOUNT
WHILE EXISTS (SELECT * FROM TableName WHERE Value <> 'abc1' AND Parameter1 = 'abc' AND Parameter2 = 123) BEGIN UPDATE TOP (1000) TableName SET Value = 'abc1' WHERE Parameter1 = 'abc' AND Parameter2 = 123 AND Value <> 'abc1' END