Noob question

Jul 25, 2013 at 7:19 PM
Edited Jul 25, 2013 at 9:23 PM
I just stumbled upon this tool. It seems a massive omission from SQL server that T-SQL does not simply support this in the DDL. The existence of this tool attests to that :(

I have not played around with switching partitions at all, but I looked at the code output for the ClearPartition command without building a test yet.

So having dropped the staging table and the data is gone, what is the state of the original table partition I just truncated? Do I have to switch the partition back to the original table, because I expect data to go in there again.

Example: Imagine I have a 8 partition table (1 for each day + the overflow). Every day the daynumber partition gets filled up and every day I need to truncate an old partition n days back. Since there are never more than 7 days in a week, the data fills up in cycles and I have an available window of n days available.

So, let us say I executed ClearPartition for Wednesday (day 3) what happens next week when Wednesday rolls around and the partition function says put the data in partition 3 of the original table?
Jul 27, 2013 at 1:15 AM

Hi Philip –

The Truncate Partition option replaces the previously filled partition with an empty one. So the partition is still there to potentially receive new data, only it is empty.

n Stuart

Sep 23, 2013 at 11:55 AM
Is there any chance the bug I logged might get fixed?

there is no workaround for this in my case.