Replacing the data in a large table

If you are replacing all the data in a large table, use the truncate table command instead of the delete command. truncate table performs reduced logging. Only the page deallocations are logged.

delete is completely logged, that is, all the changes to the data are logged.

The steps are:

  1. Truncate the table. If the table is partitioned, you must unpartition before you can truncate it.

  2. Drop all indexes on the table.

  3. Load the data.

  4. Re-create the indexes.

See “Steps for partitioning tables” for more information on using bulk copy with partitioned tables.