Package: Truncate Staging Task

The Truncate Staging task contains Transact-SQL that the package runs to truncate a table and drop the table's indexes. For example, the SSIS Package BBDW_FACT_INTERACTIONRESPONSE.dtsx for the Interaction Response fact table specifies this Transact-SQL for the Truncate Staging task:

truncate table BBDW.[FACT_INTERACTIONRESPONSE_STAGE];
exec BBDW.[CREATE_OR_DROP_FACT_INTERACTIONRESPONSE_STAGE_INDICES] 0;

Staging tables are a buffer between data warehouse tables and an OLTP database.

This Transact-SQL removes all of the rows in the staging table for Interaction Response table and the drops all of the staging indexes. CREATE_OR_DROP_FACT_INTERACTIONRESPONSE_STAGE_INDICES creates indexes when 1 is specified and drops indexes when 0 is specified. These two lines initialize the staging table.

The section about the revisions process discusses how to add a revision to create a stored procedure such as the index drop procedure in the example. For more information, see Revisions Spec: Drop and Create Indexes.

For more information about truncating tables, see Microsoft's MSDN article at TRUNCATE TABLE (Transact-SQL).