Revisions Spec: Truncate Tables and Drop Indexes

The following element, contained within a revisions spec, contains embedded Transact-SQL. The deployment utility runs the Transact-SQL which alters the reset stored procedure to add a table truncation and to drop indexes. For more information about the ALTER PROCEDURE statement, see Microsoft's MSDN article at ALTER PROCEDURE (Transact-SQL).

When you use this revision, ensure you include the truncations and index drops from all previous revisions. An ALTER PROCEDURE statement in this form will overwrite the contents of the stored procedure. We recommend that you maintain a running list of truncations and index drops to paste into these revisions.

Recall the revision to create the RESETETL_EXT stored procedure Revisions Spec: Reset

Revisions Spec: Reset

  <DBRevision ID="25">
    <ExecuteSql>
      <![CDATA[	
alter procedure BBDW.[RESETETL_EXT]
as
  set nocount on; 
  
  truncate table BBDW.[DIM_CONSTITUENTADDRESS_EXT_STAGE];
  exec BBDW.[CREATE_OR_DROP_DIM_CONSTITUENTADDRESS_EXT_STAGE_INDICES] 0;
      ]]>
    </ExecuteSql>
  </DBRevision>