in reply to dropping or deleting tables
Using drop table/create table has the advantage of not invalidating the transaction log. The disadvantage is that any procedure/trigger/view that refers to the table will need to be re-resolved the next time it runs. In bad cases such procedures may need to be reloaded.
Using delete ... from table offers the best recoverability in case of errors as the operation is logged. This is also it's largest drawback as it makes it slower than the other options, and if the table is large you may need a large transaction log.
Using truncate table is the fastest, but it is a minimally logged operation. A truncate table command invalidates the transaction log, which means that you must take a full database backup after the truncate to be able to recover the database after the truncate (assuming you don't have trunc log on checkpoint turned on in that database, of course).
Hope this helps...
Michael
|
|---|