Sie sind auf Seite 1von 2

SHIFTING OF PARTITIONS FROM ONE TABLE TO ANOTHER GENERAL REQUIREMENTS:

Both tables must exist before the SWITCH operation. The table from which the partition is being moved (the source table) and the table that is receiving the partition (the target table) must exist in the database before you perform the switch operation. The receiving partition must exist and it must be empty. Whether you are adding a table as a partition to an already existing partitioned table, or moving a partition from one partitioned table to another, the partition that receives the new partition must exist and it must be an empty partition. The receiving nonpartitioned table must exist and it must be empty. If you are reassigning a partition to form one nonpartitioned table, the table that receives the new partition must exist and it must be an empty nonpartitioned table. Partitions must be on the same column. If you are switching a partition from one partitioned table to another, both tables must be partitioned on the same column. Source and target tables must share the same filegroup. The source and the target table of the ALTER TABLE...SWITCH statement must reside in the same filegroup, and their large-value columns must be stored in the same filegroup. Any corresponding indexes, index partitions, or indexed view partitions must also reside in the same filegroup. However, the filegroup can be different from that of the corresponding tables or other corresponding indexes.

SYNTAX FOR SWITCHING PARTITIONS FROM PARTITIONED TABLES TO NON PARTITION TABLE.......

ALTER TABLE (SOURCE TABLE NAME) SWITCH PARTITION (PARTITION NUMBER) TO (TARGET TABLE NAME)

SYNTAX FOR SWITCHING PARTITIONS FROM PARTITIONED TABLES TO ANOTHER PARTITION TABLE.......

ALTER TABLE source_table SWITCH [PARTITION source_partition_number]

TO destination_table [PARTITION target_partition_number]

Das könnte Ihnen auch gefallen