Using SQL Server 2005.
I am performing a huge DELETE FROM with no where clauses. It's basically equivalent to a TRUNCATE TABLE statement – except I'm not allowed to use TRUNCATE. The problem is the table is huge – 10 million rows, and it takes over an hour to complete. Is there any way of making it faster without:
- Using Truncate
- Disabling or dropping indexes?
The t-log is already on a separate disk.
Any suggestions welcome!
Best Answer
What you can do is batch deletes like this:
Where xxx is, say, 50000
A modification of this, if you want to remove a very high percentage of rows...