Saturday, October 6, 2007

Partition to Partition Switching
The Partition 2 of dbo.Summer is empty.

ALTER TABLE dbo.customer SWITCH PARTITION 2 TO dbo.Summer PARTITION 2
The Partition 1 of dbo.Customer is empty.
ALTER TABLE dbo.Summer SWITCH PARTITION 1 TO dbo.Customer PARTITION 1

To be successful, the following conditions must be met:

A full partition must be switched with an empty partition;

Both tables must be aligned (must use the same partition function and partition scheme);

Both tables must have exactly the same structure for tables as well as indexes;

The range of values in the partition being switched must not exist in the target table.