Groups | Blog | Home
all groups > sql server programming > may 2005 >

sql server programming : Delete with no LOG?


Patrick
5/16/2005 7:17:45 PM
Hi Freinds,
SQL 2000
I have to delete 8,000,000 record from a teble which has 45,000,000 records.
There are index files also with that table.

Is there any option to delete with no logging? I already changed my SQL
DATABASE type to simple, but again it take long time to delete 8000000
records, just because it is logging it.

Thanks,
Pat

Thomas Coleman
5/16/2005 8:17:11 PM
Drop all of the foreign key references to the table, use Truncate Table
<tableName> and then re-create the references.


Thomas


[quoted text, click to view]

Uri Dimant
5/17/2005 12:00:00 AM
Patrick
Divide the transaction into small ones
SET ROWCOUNT 10000 -----Instead of 8000000
WHILE 1 = 1
BEGIN
-----DELETE FROM Table WHERE .........
IF @@ROWCOUNT = 0
BEGIN
BREAK
END
END

SET ROWCOUNT 0

[quoted text, click to view]

AddThis Social Bookmark Button