Delete 29 million rows from 1 billion rows table. (SQL Server 2008)
I need suggestions from experts.
I need to delete 29 million rows from 1 billion rows table. This is SQL Server 2008.
I am sure foillowing query will work. I know that it will take an couple of hours or more to run it.
Does anybody have any suggestions/improvments in following queries? My main aim is to have these queries consume minimum resources and avoid 'transaction log full' error.
Declare @rows int
set @rows= 1
WHILE @rows > 0
DELETE TOP (100000) FROM HugeTable
Where Key < 29660822