Truncate is much faster because it is something you cannot recover from the transaction logs. Because this is dangerous in the wrong hands, normally only system admins have the rights to do this.
Delete is slower but can be recovered if someone accidentally deletes. Also the delete statement can have qualifiers so that only a portion of the records are deleted. Truncate will wipe out the whole table no matter what.
I personally prefer not to use truncate on a table unless I can easily recover by re-importing the data or if I want to clean out a table that had test records, so that the real records can be put in instead. Believe me you don't want to accidentally truncate the main table that your whole application is dependent on.
I can't find it but maybe someone else can. There was a extensive thread on recovering from delete/truncate transactions. It may be worth searching hard then I apparently can
____________ signature below ______________
You are a amateur developer until you realize all your code sucks.
Jeff Atwood
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.