Home     Documentation     Sliding window scenario

Sliding Window Scenario

1. The situation

Forward » « Back

While the previous tutorial illustrates how to partition tables with data, this scenario covers the usage of partitioned tables and illustrates how to split, merge and switch partitions.

The table used in this scenario was partitioned in the previous tutorial.

The table TransactionHistory is partitioned by month and includes data for the current year. Currently there are 13 partitions with data; the lower boundary value of the first partition with data is September 1st, 2003 and the upper boundary value of the last partition is October 1st, 2004.

The archive table TransactionHistoryArchive contains a partition with all data before September 1, 2003, and one partition which is empty.

Operations to do with partitioned tables usually include the following: at the end of each month, a new partition is added to the already-existing TransactionHistory table, and the earliest month of data that is currently in the TransactionHistory table is switched to the TransactionHistoryArchive table. This can be easily done with SQL Partition Manager.

The situation