truncate table referenced by an indexed view (partitioned tables/indexed views switch-in/out)

  • I have a partitioned table and a partitioned index view on the table. As part of the clean up process, data from the partitioned table is switched out into a staging table.

    My understanding is that I also need a staging indexed view for when the table is switched out.

    The problem I'm running into is that before the switch-out, I truncate the staging table. However, because the staging table is referenced by the staging indexed view, I cannot truncate the staging table.

    Has anyone faced similar issues before? I would appreciate if someone can guide me to a solution.

  • N_Muller (8/25/2014)


    I have a partitioned table and a partitioned index view on the table. As part of the clean up process, data from the partitioned table is switched out into a staging table.

    My understanding is that I also need a staging indexed view for when the table is switched out.

    The problem I'm running into is that before the switch-out, I truncate the staging table. However, because the staging table is referenced by the staging indexed view, I cannot truncate the staging table.

    Has anyone faced similar issues before? I would appreciate if someone can guide me to a solution.

    Quick thought, drop and recreate the constraints in the process.

    😎

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply