The following example creates a partition function to partition a table or index into four partitions. A partition scheme is then created that specifies the filegroups to hold each one of the four partitions. This example assumes the filegroups already exist in the database.
The partitions of a table that uses partition function myRangePF1 on partitioning column col1 would be assigned as shown in the following table.
Filegroup |
test1fg |
test2fg |
test3fg |
test4fg |
Partition |
1 |
2 |
3 |
4 |
Values |
col1 <= 1 |
col1 > 1 AND col1 <= 100 |
col1 > 100 AND col1 <= 1000 |
col1 > 1000 |