Divide big delete into several small ones

  • One point to add to this is that you MUST set your rowcount to 0 after the loop! Not doing so will limit all your following queries to the same 1000 records and may really cuase problems. 🙂

    Also this can be a way of keeping your log file from growing too large as you can truncate the log inside the loop if needed as well.

    Gary Johnson

    Microsoft Natural Language Group

    DBA, Sr. DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • Another point to note is that you can stop this type of query at any point with out losing work already done. So if youe query locks up tables and holds up other users you can easily just stop it. and continue later.

Viewing 2 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply