January 15, 2002 at 5:41 am
What is the best method to move big quantity of rows from one table no another and to delete rows (delete is very slow).
January 15, 2002 at 5:55 am
If you are deleting all the rows from a table try using 'truncate table' it is a lot faster than deleting than all
Steven
January 15, 2002 at 6:23 am
I need delete 2.000.000 from 20.000.000
January 15, 2002 at 7:29 am
If you're having to delete a range, the TRUNCATE TABLE is out, as it drops everything at once. Are you deleting in block, say:
DELETE FROM MyTable
WHERE MyID BETWEEN 2000000 AND 20000000
If you are, I don't know of any faster methods.
K. Brian Kelley
http://www.sqlservercentral.com/columnists/bkelley/
K. Brian Kelley
@kbriankelley
February 5, 2002 at 5:51 am
Really not much you can do as deletes are logged operations and that is what slows them down. You could however for the sake of time drop any non-clustered indexes first as the delete will actually go and remove each item from the inde as it is deleted then add them back when done. This may speed things up a bit.
February 5, 2002 at 6:19 am
Especially if its a one time or off peak job I'll usually break the deletes up into chunks. Its one transaction and 2 mil rows is a BIG transaction!
Andy
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply