I want update 12 carore records. I want to update from record 1 to 5000, then from 5001 to 10000, then from 10001 to 15000 and so on. How to do it in a loop. Query is here but it always update first 5000. How to update next 5000 record from 50001 to 10,000 and then from 10,001 to 15000.
SET ROWCOUNT 5000
WHILE (1=1) BEGIN
set newformularydtl.ddid=b.ddid from newformularydtl a,Medispan.dbo.mmw_drug_pack b
IF @@ROWCOUNT = 0