• If your trim job has any significant number of rows in it, it is generally advisable to expire the rows in batches of N rows. One very easy way to implement this is to do:

    set rowcount @pBatchCntDelete -- Limit number of rows to select

    and then run the delete in a loop until no rows are affected.

    Of course it will perform far better if you can base your deletions on the clustered key. If you aren't using an index and have to delete by table scan, then you would not want to batch the delete as above.