I have a table within a MSSQL database that contains more than 100 Million records spread over about 100 days worth of data. I need to purge some of this data based on its date which is an indexed field in the table. I've tried doing a DELETE FROM against an individual date but it was taking a long long time to execute and was causing a drop in server performance. Is there a better way of deleting such a large number of records? Some of this data is still required so unfortunately I can't use truncate.
Many Thanks
Nick
Best Answer
I have had the best success when doing similar tasks with the following flow:
One major benefit of this is that your indexes will be rebuilt as you put the data back into the original table.