How to efficiently delete rows while NOT using Truncate Table in a 500,000+ rows table

Calling DELETE FROM TableName will do the entire delete in one large transaction. This is expensive.

Here is another option which will delete rows in batches :

deleteMore:
DELETE TOP(10000) Sales WHERE toDelete="1"
IF @@ROWCOUNT != 0
    goto deleteMore

Leave a Comment