• steven.ensslen (11/6/2013)


    If I had to guess, the problem is that a single DELETE is too large to fit in the transaction log. DELETE is the wrong tool for the job. A cursor loop reduces the size of each transaction, so they would not overflow the log, but it is still naive.

    The correct solution here is to partition the table. The SWITCH out the old partition with all of its data.

    http://technet.microsoft.com/en-us/magazine/2007.03.partitioning.aspx

    It depends as the OP is not interested on keeping old data.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2