Delete Rows

VeRiTo
04-15-2004, 09:55 AM
Hi people, i have a table wich has 980000 rows (at least). I have to delete it to fill it again from a text file. (this task is executed every 20 days more o less).
It takes so long to DELETE all rows. Is there any way to do it better? Maybe if i drop the table and i create it again... i have no clue. :confused: Any help?
Thanks in advance. :D
Bye!

LaVolpe
04-15-2004, 10:00 AM
SQL Server? Yep, that's what we do at work for tables containing 1 million + records.

MKoslof
04-15-2004, 10:16 AM
Well, if you are going to delete all records, then populate with a bunch of complete new records...the DROP Table method is probably the quickest. Since, you are basically starting from scratch anyway...there is nothing wrong with using this method.

VeRiTo
04-15-2004, 11:15 AM
Thanks for answering.
Is "DROP TABLE/CREATE TABLE" quicker than "TRUNCATE TABLE"?

VeRiTo
04-15-2004, 11:16 AM
I am sorry, i forgot to tell. This is MSSQL SERVER 2000.
:)

DaddyHarris
04-15-2004, 12:51 PM
Truncate is faster...It does not write to the log. You are deleting ALL rows. Truncate gets rid of all rows...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum